-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (26 loc) · 936 Bytes
/
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
################################################################
FROM python:3.12-alpine as build
# Make sure we use the virtualenv:
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
WORKDIR /build-pkg
# Install pip requirements
COPY . /build-pkg
RUN apk add --no-cache git \
&& pip install --no-cache-dir -U pip -r requirements-build.txt \
&& rm -rf dist \
&& python -m build \
&& pip uninstall -r requirements-build.txt -y \
&& pip install --no-cache-dir "$(ls /build-pkg/dist/pygitver-*.tar.gz)"
################################################################
FROM python:3.12-alpine
ENV PYGITVER_ROOT="/pygitver"
# Install dependencies
RUN apk add --no-cache git openssh
# Copy application code and
COPY ./src/pygitver/scripts /pygitver/scripts
COPY --from=build /opt/venv /opt/venv
WORKDIR /app
# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"
ENTRYPOINT ["pygitver"]