Skip to content

Commit b076e3b

Browse files
committed
Use alpine python to reduce image size
Fixes #3
1 parent fcf697d commit b076e3b

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.3]
9+
10+
### Changed
11+
12+
- Using alpine python (3.12) instead of 3.14 from uv (#3)
13+
814
## [1.2]
915

1016
### Fixed
@@ -13,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1319

1420
### Changed
1521

16-
- Defaulting to INFO log level unless `DEBUG` ENV is present
22+
- Defaulting to INFO log level unless `DEBUG` ENV is present (#2)
1723
- Using offspot-config 2.9.0
1824

1925
## [1.1] - 2025-12-01

Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
FROM alpine:3.22
22
LABEL org.opencontainers.image.source=https://github.com/offspot/adminui
33

4-
COPY --from=ghcr.io/astral-sh/uv:0.9.9 /uv /uvx /bin/
5-
RUN apk add --no-cache curl dumb-init yaml
6-
COPY pyproject.toml /src/
4+
RUN apk add --no-cache curl dumb-init yaml python3
5+
COPY pyproject.toml README.md /src/
76
WORKDIR /src
8-
RUN uv sync --no-install-project
7+
RUN python3 -m venv .venv \
8+
&& .venv/bin/pip install -U pip \
9+
# fake stub module to install deps via pip
10+
&& mkdir -p src/adminui \
11+
&& touch src/adminui/__init__.py \
12+
&& .venv/bin/pip install -e .
913

1014
ENV STATIC_DIR=/var/www/static
1115
RUN \
@@ -32,7 +36,8 @@ COPY src /src/src/
3236
RUN \
3337
ls -lh /src/src/adminui/static/ \
3438
&& mv /src/src/adminui/static/*.js /src/src/adminui/static/branding ${STATIC_DIR}/ \
35-
&& uv sync
39+
&& .venv/bin/pip install -e . \
40+
&& rm -rf /root/.cache/pip
3641

3742
EXPOSE 80
3843
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "adminui"
77
version = "0.1.0"
88
description = "Hotspot Admin UI"
99
readme = "README.md"
10-
requires-python = ">=3.13"
10+
requires-python = ">=3.12"
1111
dependencies = [
1212
"fastapi[standard]==0.120.1",
1313
"fastapi-login==1.10.3",

0 commit comments

Comments
 (0)