-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (32 loc) · 1.08 KB
/
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
38
39
40
41
42
43
44
# builder container
# - builds the frontend app (Vue, React, Webpack, ...)
# Use an official node image
FROM --platform=$BUILDPLATFORM node:14-alpine AS builder
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
# Reads args and use them to configure the build, setting
# them as env vars
ARG NODE_ENV
ARG API_URL
ENV NODE_ENV $NODE_ENV
ENV API_URL $API_URL
WORKDIR /app
# Install dependencies
COPY yarn.lock ./
COPY .package.json.without.version ./package.json
#RUN yarn install
RUN yarn cache clean
COPY . .
RUN VERSION=`cat .version`; sed -i "s/%BELIS_VERSION%/$VERSION/" src/constants/versions.js
RUN HASH=`cat .githash`; sed -i "s/%BELIS_HASH%/$HASH/" src/constants/versions.js
RUN yarn run build
# ---
# runner container
# - nginx, to serve static built Vue app
# Use an official nginx image
FROM nginx:1.13-alpine
# COPY dist from builder container to nginx html dir
COPY --from=builder /app/build /usr/share/nginx/html
#COPY config/nginx.default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
# No need for CMD. It'll fallback to nginx image's one, which