-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (36 loc) · 1.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM python:3.13-slim-bookworm AS base
WORKDIR /app
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install --no-install-recommends -y build-essential python3-dev
ENV VIRTUAL_ENV="/app/.venv"
RUN python -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# ---- Dependencies ----
FROM base AS build
WORKDIR /app
COPY . .
RUN make install && \
make bundle
# --- Release with Alpine ----
FROM debian:bookworm-slim AS release
LABEL org.opencontainers.image.source=https://github.com/drolx/pepper-local
LABEL org.opencontainers.image.description="Pepper Local"
LABEL org.opencontainers.image.licenses=MIT
ENV DATABASE_URL=postgresql+psycopg2://postgres:postgres@postgres:5432/pepper
ENV API_BASE_URL=https://app.example.com
ENV API_PASS=password
ENV GEOCODE_URL=https://nominatim.openstreetmap.org
ENV FETCH_INTERVAL=630
ENV OFFLINE_INTERVAL=90
# Create app directory
WORKDIR /app
COPY --from=build /app/dist .
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y curl && \
apt-get clean
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=5 CMD curl --fail http://localhost:8080/ || exit 1
CMD ["/app/pepper-local"]