portier/Dockerfile

35 lines
862 B
Docker
Raw Permalink Normal View History

FROM python:3.12-alpine
2020-04-15 21:00:04 +02:00
WORKDIR /app
2020-04-20 18:56:29 +02:00
# set env
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# install required packages
RUN apk add --no-cache postgresql-dev gcc python3-dev musl-dev gettext postgresql-client nginx supervisor
2020-04-20 18:56:29 +02:00
# install dependencies
2024-02-25 21:23:21 +01:00
ADD ./source/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 supervisor and nginx configs
ADD ./docker/nginx.conf /etc/nginx/nginx.conf
ADD ./docker/supervisor*.conf /etc/
# add user
RUN addgroup -S portier && adduser -S portier -G portier
2020-04-20 18:56:29 +02:00
# add code
2024-02-25 21:23:21 +01:00
ADD --chown=portier:portier ./source/ /app/
# add static external libraries for frontend
RUN ./fetch_frontend_libs.sh \
&& chown -R portier:portier static/
# collect static files and compile localized strings
RUN ./manage.py collectstatic --noinput --link
RUN ./manage.py compilemessages
ENV COMPONENT=web
CMD ["/app/start.sh"]