-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (18 loc) · 791 Bytes
/
Dockerfile
File metadata and controls
28 lines (18 loc) · 791 Bytes
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
ARG PYTHON_VERSION=3.10-slim-buster
FROM python:${PYTHON_VERSION}
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN mkdir -p /code
WORKDIR /code
COPY requirements.txt /tmp/requirements.txt
RUN set -ex && \
pip install --upgrade pip && \
pip install -r /tmp/requirements.txt && \
rm -rf /root/.cache/
COPY . /code/
RUN python3 manage.py collectstatic --noinput
RUN python3 manage.py migrate
RUN echo "from user.models import MyUser; user = MyUser.objects.create_superuser(email='admin@mail.com', name='admin', password='admin', phone='08111111', birth_date='2000-01-01', address='x', medical_description='x')" | python3 manage.py shell
EXPOSE 8000
# replace demo.wsgi with <project_name>.wsgi
CMD ["gunicorn", "--bind", ":8000", "--workers", "2", "backend.wsgi"]