-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbillwatcher.Dockerfile
42 lines (28 loc) · 1.04 KB
/
billwatcher.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
FROM python:3.12.5-alpine3.20 AS builder
WORKDIR /app
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
COPY --from=ghcr.io/astral-sh/uv:latest /uvx /bin/uvx
COPY . .
RUN --mount=type=cache,target=/root/.cache/uv \
apk add --no-cache curl postgresql-libs \
&& apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev \
&& uv sync --frozen --no-dev \
&& uvx --from build pyproject-build --installer uv
# && uv sync --frozen --no-dev
# ENV STREAMLIT_UI_HIDE_TOP_BAR=1
# ENV STREAMLIT_SERVER_PORT=8000
# ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
# CMD ["uv", "run", "streamlit", "run", "cli/app.py"]
FROM python:3.12.5-alpine3.20
ARG HTTP_PORT=80
ARG DEFAULT_DATABASE_URL
ENV DATABASE_URL=${DEFAULT_DATABASE_URL}
WORKDIR /app
EXPOSE 80
COPY --from=builder /app/dist/*whl .
RUN apk add --no-cache postgresql-libs \
&& apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev \
&& pip install *.whl \
&& rm -rfv /app/*.whl \
&& apk del --purge .build-deps
CMD ["python3", "-m", "sinar_billwatcher"]