mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
0eb57aae41
- Add Dockerfile to build angular file and serve with nginx - Add nginx conf file to serve builded angular files when image run - Add dockerignore to limit docker context
27 lines
516 B
Docker
27 lines
516 B
Docker
# Create stage to build angular application
|
|
FROM node:18.15.0-alpine AS angular-builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json .
|
|
|
|
RUN yarn install
|
|
|
|
COPY . .
|
|
|
|
RUN yarn run build:prod
|
|
|
|
# Build NGINX Image to serve builded files
|
|
FROM nginx:stable-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
RUN rm -rf /usr/share/nginx/html/*
|
|
|
|
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
|
|
|
|
# Copy dist folder fro build stage to nginx public folder
|
|
COPY --from=angular-builder /app/dist/framadate /app
|
|
|
|
# Start NgInx service
|
|
CMD ["nginx", "-g", "daemon off;"] |