forked from florianporada/another-webpack-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (26 loc) · 983 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Building phase
FROM node:16-buster as builder
LABEL description="Another webpack boilerplate"
# Run those steps during build phase
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Copy files
ADD . ./
# Install modules
RUN yarn
# Build app
RUN yarn run build
# Production phase
FROM nginx:alpine
# production is the default, but you can override it with --build-arg NODE_ENV=development during docker build
ARG NODE_ENV=production
ENV NODE_ENV $NODE_ENV
# unknown is the default, but you can override it with --build-arg APP_VERSION=$(echo "1.0.0") during docker build
ARG APP_VERSION=unknown
ENV APP_VERSION $APP_VERSION
# unknown is the default, but you can override it with --build-arg RELEASE_DATE=$(date +"%Y/%m/%d") during docker build
ARG RELEASE_DATE=unknown
ENV RELEASE_DATE $RELEASE_DATE
LABEL com.florianporada.author="florianporada"
COPY --from=builder /usr/src/app/dist /usr/share/nginx/html
COPY --from=builder /usr/src/app/nginx.conf /etc/nginx/nginx.conf