mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-05-24 18:39:12 +00:00

* infra: Build images for all branches without the need of tags. Stop using latest tag on container image. * Fix npm install on docker There are errors when the branch is not ready to be merged. This is a temporary fix to make the docker image buildable on all branches.
15 lines
490 B
Docker
15 lines
490 B
Docker
# Stage 1: Build the app
|
|
FROM node:20-alpine AS build
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm install && \
|
|
npm ci
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Stage 2: Setup the Nginx Server to serve the app
|
|
FROM nginx:stable-alpine3.17 AS production
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
RUN echo 'server { listen 80; server_name _; root /usr/share/nginx/html; location / { try_files $uri /index.html; } }' > /etc/nginx/conf.d/default.conf
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"] |