generated from brylie/django-bootstrap-quick-start
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
40 lines (28 loc) · 879 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
38
39
40
FROM python:3.9
LABEL maintainer="[email protected]"
ENV PYTHONUNBUFFERED 1
ENV DJANGO_ENV dev
RUN pip install --upgrade pip
# We use gunicorn to serve the project
RUN pip install gunicorn
# Poetry is used to manage dependencies
RUN pip install poetry
WORKDIR /app/
COPY /project/ /app
COPY pyproject.toml /app
COPY poetry.lock /app
COPY Procfile /app
# Note: we don't want Poetry to create a virtual environment
# Instead, it should use a local directory
RUN poetry config virtualenvs.create false
# Install Poetry dependencies
RUN poetry install --no-dev
# Collect static files.
RUN python manage.py collectstatic --noinput --clear
RUN useradd wagtail
RUN chown -R wagtail /app
USER wagtail
# Port used by this container to serve HTTP.
EXPOSE 5000
# Run the server
CMD set -xe; gunicorn --worker-tmp-dir /dev/shm core.wsgi:application --bind 0.0.0.0:5000 --workers 3