-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (27 loc) · 1.31 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
FROM python:3.9.13-alpine3.16 AS base
LABEL org.opencontainers.image.title="Keypr" \
org.opencontainers.image.description="Configuration Keeper for GitHub Repositories." \
org.opencontainers.image.url="https://github.com/fr-platform/keypr/blob/main/README.md" \
org.opencontainers.image.documentation="https://github.com/fr-platform/keypr/wiki" \
org.opencontainers.image.source="https://github.com/fr-platform/keypr" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.vendor="Fr Platform" \
org.opencontainers.image.base.name="registry.hub.docker.com/python/python:3.9.13-alpine3.16"
WORKDIR /app
ENV PYTHONPATH /app
ENV GH_CONFIG_DIR /app/gh_config
RUN addgroup -S python \
&& adduser -S python -G python \
&& apk update \
&& apk add --no-cache --virtual .build-deps curl \
&& apk add --no-cache git github-cli \
&& apk del --purge .build-deps \
&& mkdir --mode=777 /app/gh_config \
&& chown --recursive python:python /app/gh_config
COPY --chown=python:python requirements.txt ./
RUN pip install --no-cache-dir --no-color --no-python-version-warning --disable-pip-version-check --requirement requirements.txt \
&& rm -f requirement.txt
FROM base AS deploy
COPY --chown=python:python src keypr
USER python
CMD [ "python", "-m" , "keypr"]