-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (26 loc) · 855 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
33
34
35
36
37
ARG PYTHON_VERSION=3.11-slim
FROM python:${PYTHON_VERSION}
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# install psycopg2 dependencies.
RUN apt-get update && apt-get install -y \
libpq-dev \
gcc \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /code
WORKDIR /code
COPY requirements.txt /tmp/requirements.txt
# install psycopg2 dependencies.
RUN set -ex && \
pip install --upgrade pip && \
pip install -r /tmp/requirements.txt && \
rm -rf /root/.cache/
COPY . /code
# env var for building purposes
ENV SECRET_KEY "aGkCk2XY3qk7kOZ0HDXoGq5DXlshIhfpspT2bgrV13CzJWCsQa"
ENV CORS_ALLOWED_ORIGINS "localhost:5173"
ENV ALLOWED_HOSTS "http://localhost"
ENV CSRF_TRUSTED_ORIGINS "http://localhost"
RUN python manage.py collectstatic --noinput
EXPOSE 8000
CMD ["gunicorn","--bind",":8000","--workers","2","minesweeper.wsgi"]