-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
57 lines (47 loc) · 1.42 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
# Stage 1
FROM node:22.2.0 AS s1
WORKDIR /proco
COPY package.json ./
RUN yarn install
COPY . .
ARG RECAPTCHA_KEY
ENV RECAPTCHA_KEY=$RECAPTCHA_KEY
ARG API_MAPBOX_ACCESS_TOKEN
ENV API_MAPBOX_ACCESS_TOKEN=$API_MAPBOX_ACCESS_TOKEN
ARG API_BASE_URL
ENV API_BASE_URL=$API_BASE_URL
ARG B2C_CLIENT_ID
ENV B2C_CLIENT_ID=$B2C_CLIENT_ID
ARG ENV
ENV ENV=$ENV
ARG MATOMO_SITE_ID
ENV MATOMO_SITE_ID=$MATOMO_SITE_ID
ARG AIRTABLE_API_KEY
ENV AIRTABLE_API_KEY=$AIRTABLE_API_KEY
RUN echo $RECAPTCHA_KEY \
&& echo $API_MAPBOX_ACCESS_TOKEN \
&& echo $API_BASE_URL \
&& echo $B2C_CLIENT_ID
RUN yarn build
# Stage 2
FROM nginx:1.24 AS s2
# ssh
ENV SSH_PASSWD "root:Docker!"
RUN apt-get update \
&& apt-get install -y --no-install-recommends dialog \
&& apt-get update \
&& apt-get install -y --no-install-recommends openssh-server \
&& echo "$SSH_PASSWD" | chpasswd
COPY sshd_config /etc/ssh/
# add built frontend
RUN rm -rf /usr/share/nginx/html/*
COPY --from=s1 /proco/build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY ngx.conf /etc/nginx/nginx.conf
COPY start.sh /
RUN chmod 777 /start.sh
# Add Prometheus Exporter for nginx
RUN curl -L https://github.com/nginxinc/nginx-prometheus-exporter/releases/download/v1.2.0/nginx-prometheus-exporter_1.2.0_linux_amd64.tar.gz -o nginx-exporter.tar.gz \
&& tar -zxf nginx-exporter.tar.gz
ENTRYPOINT ["/bin/bash", "/start.sh"]
EXPOSE 80 2222