mirror of
https://github.com/seriousm4x/UpSnap.git
synced 2026-03-31 06:24:06 -04:00
use slim-bullseye
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -1,26 +1,24 @@
|
||||
FROM python:3-alpine as base
|
||||
FROM python:3-slim-bullseye as base
|
||||
|
||||
FROM base as builder
|
||||
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/dl-5.alpinelinux.org/g' /etc/apk/repositories && \
|
||||
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 apt-get update && apt-get -y install build-essential libssl-dev libffi-dev python3-dev cargo libpq-dev && \
|
||||
mkdir /install
|
||||
WORKDIR /install
|
||||
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 && \
|
||||
rm -rf /usr/local/venv
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
apt-get clean
|
||||
|
||||
FROM base
|
||||
|
||||
COPY --from=builder /install /usr/local
|
||||
COPY app /app
|
||||
WORKDIR /app
|
||||
RUN apk add --no-cache postgresql-dev iputils && \
|
||||
addgroup -S user && adduser -S user -G user –no-create-home && \
|
||||
RUN groupadd user && useradd -M user -g user && \
|
||||
chmod -R 755 /app && chown -R user:user /app
|
||||
USER user
|
||||
|
||||
|
||||
Reference in New Issue
Block a user