mirror of
https://github.com/seriousm4x/UpSnap.git
synced 2026-04-05 08:53:55 -04:00
added django channels, celery, redis, postgres, gunicorn and whitenoise
This commit is contained in:
28
Dockerfile
28
Dockerfile
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user