-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (31 loc) · 1.55 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
FROM python:3.12
LABEL maintainer="Donald Gray <[email protected]>"
LABEL org.opencontainers.image.source=https://github.com/dlcs/composite-handler
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV GUNICORN_WORKERS=2
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get --yes install apt-utils && apt-get --yes upgrade \
&& apt-get install -y nginx \
&& apt-get --yes install poppler-data poppler-utils \
&& apt-get --yes autoremove && apt-get --yes autoclean && apt-get --yes clean \
&& useradd --create-home --home-dir /srv/dlcs --shell /bin/bash --uid 1000 dlcs \
&& python -m pip install --upgrade pip
# Copy nginx config and create appropriate folders
COPY --chown=dlcs:dlcs ./nginx.conf /etc/nginx/nginx.conf
RUN mkdir -p /var/cache/nginx && chown -R dlcs:dlcs /var/cache/nginx && \
mkdir -p /var/log/nginx && chown -R dlcs:dlcs /var/log/nginx && \
mkdir -p /var/lib/nginx && chown -R dlcs:dlcs /var/lib/nginx && \
touch /run/nginx.pid && chown -R dlcs:dlcs /run/nginx.pid && \
chown -R dlcs:dlcs /etc/nginx && \
chmod -R 777 /etc/nginx/conf.d
RUN mkdir /srv/dlcs/app_static && chown dlcs:dlcs /srv/dlcs/app_static/
COPY --chown=dlcs:dlcs ./src/requirements.txt /srv/dlcs
RUN pip install --no-warn-script-location --requirement /srv/dlcs/requirements.txt
COPY --chown=dlcs:dlcs ./src /srv/dlcs
COPY --chown=dlcs:dlcs ./entrypoints /srv/dlcs
RUN chmod +x /srv/dlcs/entrypoint.sh
RUN chmod +x /srv/dlcs/entrypoint-api.sh
RUN chmod +x /srv/dlcs/entrypoint-worker.sh
USER dlcs
WORKDIR /srv/dlcs