dockerfile
This commit is contained in:
parent
62c2f68c64
commit
b27a8d4ead
4 changed files with 62 additions and 1 deletions
38
Dockerfile
Normal file
38
Dockerfile
Normal file
|
@ -0,0 +1,38 @@
|
|||
FROM docker.io/oven/bun:alpine AS build
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
RUN chown -R bun:bun /usr/src/app
|
||||
USER bun
|
||||
|
||||
COPY tsconfig.app.json ./
|
||||
COPY tsconfig.node.json ./
|
||||
COPY tsconfig.json ./
|
||||
COPY package.json ./
|
||||
COPY bun.lock ./
|
||||
COPY vite.config.ts ./
|
||||
COPY svelte.config.js ./
|
||||
|
||||
RUN bun install --ignore-scripts --frozen-lockfile
|
||||
|
||||
COPY public ./public
|
||||
COPY src ./src
|
||||
COPY index.html ./
|
||||
COPY nginx ./nginx
|
||||
|
||||
RUN bun run build
|
||||
|
||||
FROM nginx:stable-alpine as production
|
||||
|
||||
# copy nginx configuration in side conf.d folder
|
||||
COPY --from=build /usr/src/app/nginx /etc/nginx/conf.d
|
||||
|
||||
# Copy the build output from the dist folder into the Nginx html directory
|
||||
COPY --from=build /usr/src/app/dist /usr/share/nginx/html
|
||||
|
||||
# Expose port 80 to allow access to the app
|
||||
EXPOSE 80
|
||||
|
||||
# Run Nginx in the foreground
|
||||
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
Loading…
Add table
Add a link
Reference in a new issue