portier/Dockerfile

27 lines
545 B
Docker
Raw Permalink Normal View History

2020-04-15 21:00:04 +02:00
FROM python:3.8-alpine
WORKDIR /app
2020-04-20 18:56:29 +02:00
# set env
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
EXPOSE 8000
RUN apk update \
&& apk add postgresql-dev gcc python3-dev musl-dev gettext postgresql-client
2020-04-20 18:56:29 +02:00
# install dependencies
ADD ./requirements.txt .
2020-04-15 21:00:04 +02:00
RUN pip install -r requirements.txt
2020-04-20 18:56:29 +02:00
# add user
RUN addgroup -S portier && adduser -S portier -G portier
# add code
ADD --chown=portier:portier . /app
RUN ./manage.py collectstatic --noinput --link
RUN ./manage.py compilemessages
USER portier
2020-04-20 18:56:29 +02:00
CMD ["/app/start.sh", "migrate_start"]