feat: use alpine base image for docker

This commit is contained in:
2024-03-25 09:33:16 +01:00
parent 7db642f17f
commit 903816a47d
8 changed files with 42 additions and 16 deletions
+12 -8
View File
@@ -1,4 +1,4 @@
FROM python:3.11-slim-buster
FROM python:3.11-alpine
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
@@ -6,15 +6,19 @@ ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
COPY . /code
COPY requirements.txt /code
RUN apt-get update && \
apt-get install -y gcc vim postgresql-client nginx && \
apt-get remove --purge --auto-remove -y
RUN apk update && \
apk add gcc vim postgresql-client openrc nginx && \
apk del gcc && \
openrc && \
touch /run/openrc/softlevel && \
pip install -r requirements.txt
COPY . /code
COPY nginx/nginx.conf /etc/nginx/sites-enabled/default
RUN pip install -r requirements.txt && \
python manage.py collectstatic --noinput
RUN python manage.py collectstatic --noinput
CMD [ "bash", "./scripts/run.sh" ]
CMD [ "sh", "./scripts/run.sh" ]