takahe/docker/Dockerfile

50 lines
1.1 KiB
Docker
Raw Normal View History

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