-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
36 lines (28 loc) · 1.03 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
FROM nginx:1.27.3
ENV DIR_NGINX /etc/nginx
ENV DIR_SERVER_BLOCKS ${DIR_NGINX}/conf.d
ENV DIR_LOCATION ${DIR_SERVER_BLOCKS}/locations
ENV DIR_HTML /usr/share/nginx/html
ENV DIR_ASSETS ${DIR_HTML}/assets
ENV CORS_ENABLED false
USER root
RUN apt-get update -y && \
apt-get install -y jq && \
rm -rf ${DIR_HTML}/* && \
mkdir -p ${DIR_LOCATION} && \
# chown 1001 -R ${DIR_SERVER_BLOCKS} && \
chmod 775 -R ${DIR_SERVER_BLOCKS} && \
chmod 775 -R ${DIR_LOCATION}
# setup entry point
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
# nginx default configuration
COPY locations/*.conf ${DIR_LOCATION}/
COPY default.conf ${DIR_SERVER_BLOCKS}
# default list of environment variable names
ENV CONFIG_ENV_LIST BFF_URL,APP_BASE_HREF,CORS_ENABLED,APP_VERSION,APP_ID,PRODUCT_NAME,TKIT_PORTAL_URL
RUN chown -R 1001:1001 /var && mkdir -p /var/run && touch /var/run/nginx.pid && chmod 775 -R /var/run/nginx.pid
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
# Default build user root, runtime user 1001
# USER 1001