2022-07-08 13:22:59 +00:00
|
|
|
# syntax=docker/dockerfile:1.4
|
|
|
|
FROM --platform=$BUILDPLATFORM python:3.10-alpine AS builder
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2020-03-26 11:43:01 +00:00
|
|
|
COPY requirements.txt /app
|
2022-07-08 13:22:59 +00:00
|
|
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
|
|
|
pip3 install -r requirements.txt
|
|
|
|
|
|
|
|
COPY . /app
|
|
|
|
|
|
|
|
ENTRYPOINT ["python3"]
|
2020-03-26 10:23:50 +00:00
|
|
|
CMD ["app.py"]
|
2022-07-08 13:22:59 +00:00
|
|
|
|
|
|
|
FROM builder as dev-envs
|
|
|
|
|
|
|
|
RUN <<EOF
|
|
|
|
apk update
|
|
|
|
apk add git
|
|
|
|
EOF
|
|
|
|
|
|
|
|
RUN <<EOF
|
|
|
|
addgroup -S docker
|
|
|
|
adduser -S --shell /bin/bash --ingroup docker vscode
|
|
|
|
EOF
|
|
|
|
# install Docker tools (cli, buildx, compose)
|
|
|
|
COPY --from=gloursdocker/docker / /
|