added django channels, celery, redis, postgres, gunicorn and whitenoise

This commit is contained in:
Maxi Quoß
2021-09-19 01:55:14 +02:00
parent 1ae91a7672
commit 52d006c75b
56 changed files with 205 additions and 9697 deletions

View File

@@ -1,8 +1,28 @@
FROM python:3-alpine
FROM python:3-alpine as base
FROM base as builder
ENV PYTHONUNBUFFERED 1
WORKDIR /opt/app
COPY . .
RUN apk update && apk add --no-cache --virtual .build-deps libc-dev make gcc musl-dev python3-dev libffi-dev openssl-dev cargo postgresql-dev
RUN mkdir /install
WORKDIR /install
RUN python -m venv venv
ENV PATH="/install/venv/bin:$PATH"
COPY requirements.txt .
RUN python -m pip install --prefix=/install --no-cache-dir --upgrade pip && \
pip install --prefix=/install --no-cache-dir -r requirements.txt && \
apk del .build-deps gcc libc-dev make
RUN python -m pip install --upgrade pip && pip install -r requirements.txt
FROM base
COPY --from=builder /install /usr/local
COPY app /app
WORKDIR /app
COPY run.sh .
RUN apk add --no-cache postgresql-dev iputils
RUN addgroup -S user && adduser -S user -G user no-create-home
RUN chmod -R 755 /app && chown -R user:user /app
USER user
CMD ["./run.sh"]