forked from isichos/epa
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (39 loc) · 1.5 KB
/
Copy pathDockerfile
File metadata and controls
56 lines (39 loc) · 1.5 KB
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
FROM python:3.13-slim-bullseye
RUN echo POSTGRES
ENV APP_ROOT /src
ENV CONFIG_ROOT /config
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ARG BUILD_ENVIRONMENT=production
RUN mkdir ${CONFIG_ROOT}
COPY app/requirements/base.txt ${CONFIG_ROOT}/base.txt
COPY app/requirements/${BUILD_ENVIRONMENT}.txt ${CONFIG_ROOT}/${BUILD_ENVIRONMENT}.txt
# Install gettext utilities for translations
RUN apt-get update && \
apt-get install -y --no-install-recommends gettext-base gettext git && \
rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r ${CONFIG_ROOT}/${BUILD_ENVIRONMENT}.txt \
&& pip install gunicorn
WORKDIR ${APP_ROOT}
ADD app/ ${APP_ROOT}
COPY ./app/compose/production/app_postgres/start /start
#RUN sed -i 's/\r$//g' /start
RUN chmod +x /start
COPY ./app/compose/production/app_postgres/celery/worker/start /start-celeryworker
RUN sed -i 's/\r$//g' /start-celeryworker
RUN chmod +x /start-celeryworker
COPY ./app/compose/production/app_postgres/celery/beat/start /start-celerybeat
RUN sed -i 's/\r$//g' /start-celerybeat
RUN chmod +x /start-celerybeat
COPY ./app/compose/production/app_postgres/celery/flower/start /start-flower
RUN sed -i 's/\r$//g' /start-flower
RUN chmod +x /start-flower
RUN adduser appuser --system --no-create-home --shell /bin/sh \
&& chown -R appuser ${APP_ROOT}
RUN chown appuser /start
RUN chown appuser /start-celeryworker
RUN chown appuser /start-celerybeat
RUN chown appuser /start-flower
USER appuser
CMD ${STARTUP_COMMAND}