drawdb/Dockerfile
Enrique Calderon 40ca7d4b6e
Infra: Build container image for all branches (#5)
* 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.
2025-02-07 10:58:35 -05:00

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;"]