mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-03-06 04:44:19 +01:00
Things!
This commit is contained in:
16
containers/python/Containerfile.dev
Normal file
16
containers/python/Containerfile.dev
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM python:3.13 AS dev
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gettext
|
||||
|
||||
RUN pip install poetry~=1.8
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV POETRY_VIRTUALENVS_IN_PROJECT=1 \
|
||||
POETRY_VIRTUALENVS_CREATE=1
|
||||
|
||||
ENV VIRTUAL_ENV=/app/.venv \
|
||||
PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
ENTRYPOINT ["python","manage.py", "runserver", "0.0.0.0:8000"]
|
||||
36
containers/python/Containerfile.prod
Normal file
36
containers/python/Containerfile.prod
Normal file
@@ -0,0 +1,36 @@
|
||||
FROM python:3.13 AS builder
|
||||
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
|
||||
gettext
|
||||
|
||||
RUN pip install --no-cache-dir poetry==1.8
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV POETRY_NO_INTERACTION=1 \
|
||||
POETRY_VIRTUALENVS_IN_PROJECT=1 \
|
||||
POETRY_VIRTUALENVS_CREATE=1 \
|
||||
POETRY_CACHE_DIR=/tmp/poetry_cache
|
||||
|
||||
COPY tvdt/pyproject.toml tvdt/poetry.lock ./
|
||||
|
||||
RUN poetry install --without dev
|
||||
|
||||
COPY ./tvdt/ .
|
||||
|
||||
ENV VIRTUAL_ENV=/app/.venv \
|
||||
PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
RUN python manage.py compilemessages --ignore .venv \
|
||||
&& python manage.py collectstatic
|
||||
|
||||
FROM python:3.13 AS runtime
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV VIRTUAL_ENV=/app/.venv \
|
||||
PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
COPY --from=builder /app /app
|
||||
|
||||
ENTRYPOINT ["gunicorn", "-b", "0.0.0.0:8000", "tvdt.wsgi", ""]
|
||||
Reference in New Issue
Block a user