2022-11-27 22:20:26 -08:00
|
|
|
ARG IMAGE_HOST=python
|
2022-12-15 15:36:43 -08:00
|
|
|
ARG IMAGE_LABEL=3.11.1-slim-buster
|
2022-11-27 22:20:26 -08:00
|
|
|
|
|
|
|
FROM ${IMAGE_HOST}:${IMAGE_LABEL}
|
2022-11-08 20:05:51 -08:00
|
|
|
|
2022-12-19 03:21:04 -08:00
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
|
2022-12-04 17:31:32 -08:00
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y --no-install-recommends \
|
|
|
|
libpq5 \
|
2022-12-05 09:37:53 -08:00
|
|
|
libxslt1.1 \
|
2022-12-18 20:26:42 -08:00
|
|
|
nginx \
|
|
|
|
busybox \
|
2022-12-04 17:31:32 -08:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2022-11-08 20:05:51 -08:00
|
|
|
|
|
|
|
COPY requirements.txt requirements.txt
|
|
|
|
|
2022-12-04 17:31:32 -08:00
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y --no-install-recommends \
|
2022-12-27 10:39:18 -08:00
|
|
|
netcat \
|
2022-12-04 17:31:32 -08:00
|
|
|
gcc \
|
|
|
|
libc6-dev \
|
|
|
|
libpq-dev \
|
2022-12-05 09:37:53 -08:00
|
|
|
# Required to build lxml on arm64.
|
|
|
|
libxslt1-dev \
|
|
|
|
zlib1g-dev \
|
2022-12-06 08:49:50 -08:00
|
|
|
&& python3 -m pip install --no-cache-dir --upgrade -r requirements.txt \
|
2022-12-04 17:31:32 -08:00
|
|
|
&& apt-get purge -y --auto-remove \
|
|
|
|
gcc \
|
|
|
|
libc6-dev \
|
|
|
|
libpq-dev \
|
2022-12-05 09:37:53 -08:00
|
|
|
libxslt1-dev \
|
|
|
|
zlib1g-dev \
|
2022-12-04 17:31:32 -08:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2022-11-08 20:05:51 -08:00
|
|
|
|
2022-12-18 20:26:42 -08:00
|
|
|
RUN mkdir -p /cache
|
|
|
|
|
2022-11-08 20:05:51 -08:00
|
|
|
COPY . /takahe
|
|
|
|
|
|
|
|
WORKDIR /takahe
|
2022-11-18 16:24:43 -08:00
|
|
|
|
2022-12-16 18:51:19 -08:00
|
|
|
RUN TAKAHE_DATABASE_SERVER="postgres://x@example.com/x" python3 manage.py collectstatic --noinput
|
2022-11-18 16:24:43 -08:00
|
|
|
|
2022-11-08 20:05:51 -08:00
|
|
|
EXPOSE 8000
|
|
|
|
|
2022-11-19 09:20:13 -08:00
|
|
|
# Set some sensible defaults
|
|
|
|
ENV GUNICORN_CMD_ARGS="--workers 8"
|
|
|
|
|
2022-12-18 20:26:42 -08:00
|
|
|
CMD ["bash", "docker/run.sh"]
|