-
Notifications
You must be signed in to change notification settings - Fork 4
/
base.docker
44 lines (34 loc) · 1.56 KB
/
base.docker
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
FROM python:3.9-slim-bullseye
ARG BUILD_DATE
ARG BUILD_VERSION
ENV APP_DIR /app
ENV DEP_SUPERVISOR_VERSION 4.2.2
ENV DEP_UWSGI_VERSION 2.0.18
ENV DEP_AWSCLI_CWLOGS_VERSION 1.4.6
RUN /usr/bin/apt-get update && \
/usr/bin/apt-get install -y --no-install-recommends nginx gcc curl xz-utils git \
libpcre3-dev libpq-dev libffi-dev libxml2-dev libxslt-dev libssl-dev zlib1g-dev && \
/bin/rm -rf /var/lib/apt/lists/* && \
/usr/local/bin/pip3 install --no-cache-dir supervisor==${DEP_SUPERVISOR_VERSION} uwsgi==${DEP_UWSGI_VERSION} \
awscli-cwlogs==${DEP_AWSCLI_CWLOGS_VERSION} && \
/usr/local/bin/aws configure set plugins.cwlogs cwlogs && \
/bin/mkdir -p ${APP_DIR} && \
/bin/rm -f /etc/nginx/sites-enabled/* && \
/bin/mkdir -p /var/log/digitalmarketplace && \
/bin/chmod 777 /run && \
/usr/sbin/groupadd -r nginx && /usr/sbin/useradd --no-log-init -r -g nginx -G www-data nginx && \
/usr/sbin/groupadd -r uwsgi && /usr/sbin/useradd --no-log-init -r -g uwsgi -G www-data uwsgi
COPY supervisord.conf /etc/supervisord.conf
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY mime.types /etc/mime.types
COPY uwsgi.conf /etc/uwsgi.conf
COPY awslogs/awslogs.conf /etc/awslogs.conf
COPY nginx/run.sh /nginx.sh
COPY awslogs/run.sh /awslogs.sh
COPY supervisor_stdout.py /usr/local/lib/python3.9/site-packages
COPY supervisor_stdout.py /usr/local/bin/supervisor_stdout
LABEL BUILD_DATE=${BUILD_DATE}
LABEL BUILD_VERSION=${BUILD_VERSION}
WORKDIR ${APP_DIR}
CMD ["/usr/local/bin/supervisord", "--configuration", "/etc/supervisord.conf"]
EXPOSE 80