File tree Expand file tree Collapse file tree 3 files changed +64
-0
lines changed
Expand file tree Collapse file tree 3 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ ** /__pycache__
Original file line number Diff line number Diff line change 9898 steps :
9999 - uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
100100 - uses : hynek/build-and-inspect-python-package@b4fc3f6ba2b3da04f09659be99e2a29fb6146a61 # v2.6.0
101+
102+ docker :
103+ name : Build and run the docker image
104+ runs-on : ubuntu-24.04
105+ env :
106+ NO_COLOR : 1
107+ steps :
108+ - uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
109+ - run : pipx install hatch
110+ - name : Get package version
111+ id : package-version
112+ run : echo "version=$(hatch version)" >> $GITHUB_OUTPUT
113+ - uses : docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
114+ - name : Build and push
115+ uses : docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
116+ with :
117+ load : true
118+ tags : afuetterer/python-re3data:test
119+ build-args : VERSION=${{ steps.package-version.outputs.version }}
120+ - run : docker run --rm afuetterer/python-re3data:test --help
Original file line number Diff line number Diff line change 1+ # syntax=docker/dockerfile:1
2+
3+ # base
4+ # ----------------------------
5+ FROM python:3.12-slim as base
6+
7+ ENV PYTHONDONTWRITEBYTECODE=1 \
8+ PYTHONUNBUFFERED=1 \
9+ PIP_DISABLE_PIP_VERSION_CHECK=1 \
10+ PIP_NO_CACHE_DIR=1 \
11+ PIP_ROOT_USER_ACTION=ignore
12+
13+ # build stage
14+ # ----------------------------
15+ FROM base as build
16+
17+ WORKDIR /app
18+
19+ RUN python -m pip install build
20+
21+ COPY pyproject.toml .
22+ COPY README.md .
23+ COPY src ./src
24+
25+ RUN python -m build --wheel
26+
27+ # runtime stage
28+ # ----------------------------
29+ FROM base as runtime
30+
31+ ARG VERSION
32+
33+ RUN adduser --group --system --no-create-home re3data
34+
35+ WORKDIR /app
36+
37+ COPY --from=build /app/dist ./dist
38+
39+ RUN python -m pip install "./dist/python_re3data-$VERSION-py3-none-any.whl[cli]"
40+
41+ USER re3data
42+
43+ ENTRYPOINT ["re3data" ]
You can’t perform that action at this time.
0 commit comments