-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
42 lines (36 loc) · 1.31 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
42
FROM python:3.12-bookworm
RUN apt-get update && apt-get install -y git gettext \
libpq-dev locales build-essential sudo nginx supervisor \
--no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
dpkg-reconfigure locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8 && \
useradd -ms /bin/bash -d /src -u 15372 monostat && \
echo 'monostat ALL=(ALL) NOPASSWD:SETENV: /usr/bin/supervisord' >> /etc/sudoers && \
mkdir /etc/supervisord
ENV LC_ALL C.UTF-8
ENV DJANGO_SETTINGS_MODULE=monostat.settings
ENV MONOSTAT_DATA_DIR /data
COPY docker/monostat.bash /usr/local/bin/monostat
COPY docker/supervisord /etc/supervisord
COPY docker/supervisord.all.conf /etc/supervisord.all.conf
COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY pyproject.toml /src/pyproject.toml
COPY manage.py /src/manage.py
COPY monostat /src/monostat
RUN mkdir /static && \
cd /src && \
pip3 install -U pip setuptools wheel && \
pip3 install . gunicorn && \
pwd && \
ls -lisah * && \
DJANGO_SETTINGS_MODULE=monostat.settings python3 -m monostat collectstatic --noinput && \
DJANGO_SETTINGS_MODULE=monostat.settings python3 -m monostat compress && \
chmod +x /usr/local/bin/monostat
VOLUME /data
EXPOSE 80
USER monostat
ENTRYPOINT ["/usr/local/bin/monostat"]
CMD ["all"]