1234567891011121314151617181920212223242526272829303132333435 |
- FROM python:3.11 as build-python
- ARG IS_CI
- ENV PYTHONUNBUFFERED=1 \
- PORT=8080 \
- POETRY_VIRTUALENVS_CREATE=false \
- POETRY_HOME=/opt/poetry \
- PIP_DISABLE_PIP_VERSION_CHECK=on
- WORKDIR /code
- COPY requirements.txt /code/
- RUN pip install --no-cache-dir -r requirements.txt
- FROM python:3.11-slim
- ARG GLITCHTIP_VERSION=local
- ENV GLITCHTIP_VERSION ${GLITCHTIP_VERSION}
- ENV PYTHONUNBUFFERED=1 \
- PORT=8080
- RUN apt-get update && apt-get install -y libxml2 libpq5 && apt-get clean && rm -rf /var/lib/apt/lists/*
- WORKDIR /code
- COPY --from=build-python /usr/local/lib/python3.11/site-packages/ /usr/local/lib/python3.11/site-packages/
- COPY --from=build-python /usr/local/bin/ /usr/local/bin/
- EXPOSE 8080
- COPY . /code/
- ARG COLLECT_STATIC
- RUN if [ "$COLLECT_STATIC" != "" ] ; then SECRET_KEY=ci ./manage.py collectstatic --noinput; fi
- RUN useradd -u 5000 app && chown app:app /code && chown app:app /code/uploads
- USER app:app
- CMD ["./bin/start.sh"]
|