-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (27 loc) · 1.12 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
FROM python:3.10.15-slim-bullseye
WORKDIR /app/massassi-django
ARG APP_USER=massassi
RUN groupadd -r -g 1000 ${APP_USER} && \
useradd --no-log-init -r -g ${APP_USER} -u 1000 ${APP_USER}
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
EXPOSE 8000
RUN apt update \
&& apt -y upgrade \
&& apt -y install libpq-dev build-essential python3-virtualenv \
virtualenv postgresql-client vim
RUN mkdir /massassi-user-data && chown massassi:massassi /massassi-user-data
RUN mkdir /jedibird-static && chown massassi:massassi /jedibird-static
ENV VIRTUAL_ENV=/app/massassi-django
RUN virtualenv -p python3 /app/massassi-django
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
COPY ./requirements.txt .
RUN pip install -r requirements.txt
ENV DJANGO_SETTINGS_MODULE massassi.settings.dev
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
COPY . ./massassi-django
RUN chown -R massassi:massassi /app/massassi-django/massassi-django
USER ${APP_USER}:${APP_USER}
ENTRYPOINT ["/entrypoint.sh"]
CMD ["gunicorn", "--chdir", "/app/massassi-django/massassi-django", "massassi.wsgi:application", "--bind", "0.0.0.0:8000"]