-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
40 lines (25 loc) · 952 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.2-slim-buster
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED=1
WORKDIR /usr/src/app
RUN apt-get update \
&& apt-get -y install netcat gcc postgresql binutils libproj-dev gdal-bin python-gdal python3-gdal \
&& apt-get clean
# set user:group
RUN groupadd appuser && useradd -g users -G appuser appuser --home /usr/src/app
# change permission on workdir
RUN chown -R appuser:appuser /usr/src/app
USER appuser:appuser
ENV PATH=$PATH:/usr/src/app/.local/bin
# install dependencies
RUN pip install --upgrade pip
COPY --chown=appuser:appuser requirements.txt .
RUN pip install -r requirements.txt
COPY --chown=appuser:appuser olive_guide .
RUN python manage.py collectstatic --noinput
# TODO: superuser, migrations
WORKDIR /usr/src/app
#EXPOSE 8000/tcp
#ENTRYPOINT ["gunicorn", "--bind", "0.0.0.0:8000","olive_guide.wsgi"]
CMD gunicorn olive_guide.wsgi:application --bind 0.0.0.0:8000