-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
55 lines (44 loc) · 1.06 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
45
46
47
48
49
50
51
52
53
# use node alpine as base image
FROM node:16-alpine as base
# install system build dependencies
RUN apk add --no-cache \
make \
python3 \
build-base \
g++ \
cairo-dev \
jpeg-dev \
pango-dev \
giflib-dev
# import work files
WORKDIR /app
COPY . .
# build production files
ARG WEBSOCKET_URL
ARG SSL_ENABLE
ARG SSL_CRT_FILE
ARG SSL_KEY_FILE
ARG API_KEY
RUN export WEBSOCKET_URL=${WEBSOCKET_URL} \
SSL_CRT_FILE=${SSL_CRT_FILE} \
SSL_KEY_FILE=${SSL_KEY_FILE} \
SSL_ENABLE=${SSL_ENABLE}
RUN make
# base image for apache
FROM httpd:2.4 as apache
WORKDIR /usr/local/apache2
# production build with ssl
FROM apache as production
# copy custom apache config with ssl enabled
COPY configs/httpd.ssl.conf ./conf/httpd.conf
COPY configs/httpd-ssl.conf ./conf/extra/httpd-ssl.conf
# import built files
COPY --from=base /app/build ./htdocs
EXPOSE 443
# dev build without ssl
FROM apache as development
# copy custom apache config
COPY configs/httpd.conf ./conf/httpd.conf
# import built files
COPY --from=base /app/build ./htdocs
EXPOSE 80