-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
32 lines (26 loc) · 863 Bytes
/
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
FROM python:3.11-slim
COPY requirements.txt /tmp/requirements.txt
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
libmariadb-dev \
libjpeg-dev \
libpq-dev \
pkg-config && \
pip3 install --no-cache -r /tmp/requirements.txt && \
apt-get purge -y \
build-essential \
pkg-config && \
apt-get autopurge -y && \
apt-get autoclean && \
apt-get clean && \
rm -rf /tmp/requirements.txt /var/log/apt /var/cache/apt /var/lib/apt
COPY . /app/
WORKDIR /app
RUN mkdir -p /app/static_serve/media /app/static_serve/static && \
chown nobody:nogroup -R /app
EXPOSE 8000
USER nobody
CMD python3 manage.py collectstatic --noinput && \
python3 manage.py migrate --run-syncdb && \
gunicorn simple_personal_site.wsgi:application -b 0.0.0.0:8000