-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (36 loc) · 927 Bytes
/
Dockerfile
File metadata and controls
42 lines (36 loc) · 927 Bytes
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
ARG BASE_IMAGE=ubuntu
ARG BASE_IMAGE_RELEASE=latest
ARG BRANCH
ARG NODE_MAJOR
ARG TARGET
FROM $BASE_IMAGE:$BASE_IMAGE_RELEASE AS builder
# get arg
ARG BRANCH
ARG NODE_MAJOR
ARG TARGET=prod
# convert arg to env
ENV NODE_MAJOR=$NODE_MAJOR
ENV BRANCH=$BRANCH
ENV TARGET=$TARGET
RUN echo current branch is $BRANCH
RUN echo NODE release is $NODE_MAJOR
RUN echo current target is $TARGET it can be 'dev' or 'prod'
COPY . /var/webModules
WORKDIR /var/webModules
RUN make clean
RUN make $TARGET
# create version.json file
RUN ./mkversion.sh && cat version.json
# Clean
# remove unused web content files
RUN npm audit fix
RUN npm update
RUN make removebuildtools
RUN chmod -R 555 *
# --- START Build image ---
FROM nginx:alpine-slim
# buildkit
# COPY --from=builder --chmod=555 /var/webModules /usr/share/nginx/html
RUN apk update && apk upgrade --no-cache
COPY --from=builder /var/webModules /usr/share/nginx/html
EXPOSE 80