funky-framadate-front/docker/Dockerfile
bmartins 0eb57aae41 build(docker): Create docker configuration
- 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
2023-03-28 23:50:44 +02:00

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