This repository has been archived on 2023-09-24. You can view files and clone it, but cannot push or open issues or pull requests.
takahe/docker/Dockerfile
2022-12-04 18:31:32 -07:00

37 lines
855 B
Docker

ARG IMAGE_HOST=python
ARG IMAGE_LABEL=3.11.0-slim-buster
FROM ${IMAGE_HOST}:${IMAGE_LABEL}
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libpq5 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt requirements.txt
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gcc \
libc6-dev \
libpq-dev \
&& python3 -m pip install --upgrade -r requirements.txt \
&& apt-get purge -y --auto-remove \
gcc \
libc6-dev \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
COPY . /takahe
WORKDIR /takahe
RUN TAKAHE_DATABASE_SERVER="postgres://x@example.com/x" python3 manage.py collectstatic --noinput
EXPOSE 8000
# Set some sensible defaults
ENV GUNICORN_CMD_ARGS="--workers 8"
CMD ["gunicorn", "takahe.wsgi:application", "-b", "0.0.0.0:8000"]