fx-private-relay/Dockerfile

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 строки
1.4 KiB
Docker
Исходник Постоянная ссылка Обычный вид История

2024-11-01 20:04:25 +03:00
FROM python:3.11.10
2020-03-05 00:02:08 +03:00
ARG CIRCLE_BRANCH
ARG CIRCLE_SHA1
ARG CIRCLE_TAG
ENV CIRCLE_BRANCH=${CIRCLE_BRANCH:-unknown} \
CIRCLE_TAG=${CIRCLE_TAG:-unknown} \
CIRCLE_SHA1=${CIRCLE_SHA1:-unknown}
RUN pip install --no-cache --upgrade pip
2020-03-05 00:02:08 +03:00
RUN groupadd --gid 10001 app && \
useradd -g app --uid 10001 --shell /usr/sbin/nologin --create-home --home-dir /app app
WORKDIR /app
EXPOSE 8000
USER app
2020-10-22 20:14:44 +03:00
COPY --chown=app ./requirements.txt /app/requirements.txt
RUN pip install --no-cache -r requirements.txt
2020-10-22 20:14:44 +03:00
COPY --chown=app . /app
# When the user's Accept-Language is set to `fy`, Django's LocaleMiddleware
# doesn't load `fy-NL`. This is a workaround to force the Frysian and Swedish
# localisations to load anyway when appropriate.
2022-03-11 14:19:06 +03:00
RUN ln --symbolic /app/privaterelay/locales/fy-NL/ privaterelay/locales/fy
RUN ln --symbolic /app/privaterelay/locales/sv-SE/ privaterelay/locales/sv
RUN ln --symbolic /app/privaterelay/locales/pt-BR/ privaterelay/locales/pt
RUN ln --symbolic /app/privaterelay/locales/es-ES/ privaterelay/locales/es
2020-10-22 20:14:44 +03:00
COPY --chown=app .env-dist /app/.env
2020-03-05 00:02:08 +03:00
2022-11-17 01:40:10 +03:00
# Collect all staticfiles, including for apps that may be disabled
RUN PHONES_ENABLED=True \
API_DOCS_ENABLED=True \
mkdir -p /app/staticfiles && \
2022-03-25 22:43:02 +03:00
python manage.py collectstatic --no-input -v 2
2020-03-06 00:16:46 +03:00
ENTRYPOINT ["/app/.local/bin/gunicorn"]
CMD ["--config", "gunicorn.conf.py", "privaterelay.wsgi:application"]