forked from smswithoutborders/SMSWithoutBorders.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (50 loc) · 1.31 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
54
55
56
57
58
59
# 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 SWOB_BE_HOST
ARG SWOB_GS_HOST
ARG SWOB_RECAPTCHA_ENABLE
ARG SWOB_RECAPTCHA_SITE_KEY
ARG SWOB_SSL_ENABLE
ARG SWOB_SSL_CRT_FILE
ARG SWOB_SSL_KEY_FILE
RUN export SWOB_BE_HOST=${SWOB_BE_HOST} \
SWOB_GS_HOST=${SWOB_GS_HOST} \
SWOB_RECAPTCHA_ENABLE=${SWOB_RECAPTCHA_ENABLE} \
SWOB_RECAPTCHA_SITE_KEY=${SWOB_RECAPTCHA_SITE_KEY} \
SWOB_SSL_ENABLE=${SWOB_SSL_ENABLE} \
SWOB_SSL_CRT_FILE=${SWOB_SSL_CRT_FILE} \
SWOB_SSL_KEY_FILE=${SWOB_SSL_KEY_FILE} \
SWOB_SSL_ENABLE=${SWOB_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