-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
50 lines (37 loc) · 1.03 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
39
40
41
42
43
44
45
46
47
48
49
50
# _
# _ __ ___ ___ __ _| |_ ___
# | '__/ _ \ / __/ _` | __/ __|
# | | | (_) | (_| (_| | |_\__ \
# |_| \___/ \___\__,_|\__|___/
#
# https://github.com/rocats/apigateway-interceptor
#
# Copyright (C) 2023 @rocats
#
# This is a self-hosted software, liscensed under the Apache License.
# See /License for more information.
ARG APP_DIR="/app"
### BUILDER ###
FROM cgr.dev/chainguard/python:latest-dev as builder
ARG APP_DIR
ENV LANG=C.UTF-8 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PATH="${APP_DIR}/venv/bin:$PATH"
WORKDIR ${APP_DIR}
USER root
RUN python -m venv venv
ADD requirements.prod.txt ${APP_DIR}/requirements.txt
RUN pip install -U pip
RUN pip install --no-cache-dir -r requirements.txt
RUN rm -f ${APP_DIR}/bin/pip*
### PROD ###
FROM cgr.dev/chainguard/python:latest as prod
ARG APP_DIR
ENV PYTHONUNBUFFERED=1 \
PATH="${APP_DIR}/venv/bin:$PATH"
WORKDIR ${APP_DIR}
COPY --from=builder ${APP_DIR}/venv ./venv
COPY src/ ./
ENTRYPOINT [ "python" ]
CMD [ "index.py" ]