Make dockerable for hscloud

This commit is contained in:
Dariusz Niemczyk 2023-07-11 23:29:54 +02:00
parent ad73094b67
commit bfe9d27d71
No known key found for this signature in database
2 changed files with 15 additions and 4 deletions

View File

@ -11,3 +11,7 @@ postgres-hstore/
docker-compose.yml
docker-compose.override.yml
build_static
.venv
.vscode
.history
log

View File

@ -1,11 +1,18 @@
FROM python:3.5.9@sha256:3a71fd2dac2343263993f4ab898c9398dfbfd0235dafe41e784876b69bdfa899
FROM python:3.11.4-slim-bookworm
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
RUN apt-get update && apt-get install -y --no-install-recommends \
libpq-dev \
gcc \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ADD requirements.txt /code/
RUN pip install --no-cache-dir -r requirements.txt
RUN wget https://github.com/vishnubob/wait-for-it/raw/8ed92e8cab83cfed76ff012ed4a36cef74b28096/wait-for-it.sh -O /usr/local/bin/wait-for-it && chmod +x /usr/local/bin/wait-for-it
ADD . /code/
RUN python manage.py collectstatic
CMD bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
RUN python -m pip install gunicorn
RUN python manage.py collectstatic
CMD bash -c "python manage.py migrate && gunicorn -b 0.0.0.0:8001 spejstore.wsgi:application"