mirror of
https://github.com/seriousm4x/UpSnap.git
synced 2026-03-31 06:24:11 -04:00
use alpine image to fix #3
This commit is contained in:
18
Dockerfile
18
Dockerfile
@@ -1,26 +1,26 @@
|
||||
FROM python:3.10-slim-bullseye as base
|
||||
FROM python:3.10-alpine as base
|
||||
|
||||
FROM base as builder
|
||||
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
RUN apt-get update && apt-get -y install build-essential libssl-dev libffi-dev python3-dev cargo libpq-dev && \
|
||||
RUN apk update &&\
|
||||
apk add python3-dev musl-dev build-base gcc libffi-dev libressl-dev postgresql-dev cargo &&\
|
||||
rm -rf /var/cache/apk/* &&\
|
||||
mkdir /install
|
||||
WORKDIR /install
|
||||
COPY requirements.txt .
|
||||
RUN python -m pip install --no-cache-dir --upgrade pip && \
|
||||
pip install --prefix=/install --no-cache-dir -r requirements.txt && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
apt-get clean
|
||||
RUN python -m pip install --no-cache-dir --upgrade pip &&\
|
||||
pip install --prefix=/install --no-cache-dir -r requirements.txt
|
||||
|
||||
FROM base
|
||||
|
||||
COPY --from=builder /install /usr/local
|
||||
COPY app /app
|
||||
WORKDIR /app
|
||||
RUN apt-get update && \
|
||||
apt-get -y install iputils-ping nmap curl && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN apk update &&\
|
||||
apk add iputils nmap curl bash &&\
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
HEALTHCHECK --interval=10s \
|
||||
CMD curl -fs "http://localhost:$DJANGO_PORT/health/" || exit 1
|
||||
|
||||
Reference in New Issue
Block a user