2022-07-05 15:58:31 +00:00
|
|
|
# syntax = docker/dockerfile:1.4
|
2021-10-10 21:38:34 +00:00
|
|
|
|
2022-07-05 15:58:31 +00:00
|
|
|
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9-slim AS builder
|
2021-10-10 21:38:34 +00:00
|
|
|
|
2022-07-05 15:58:31 +00:00
|
|
|
WORKDIR /app
|
2021-10-10 21:38:34 +00:00
|
|
|
|
|
|
|
COPY requirements.txt ./
|
2022-07-05 15:58:31 +00:00
|
|
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
|
|
|
pip install -r requirements.txt
|
2021-10-10 21:38:34 +00:00
|
|
|
|
|
|
|
COPY ./app ./app
|
|
|
|
|
2022-07-05 15:58:31 +00:00
|
|
|
FROM builder as dev-envs
|
|
|
|
|
|
|
|
RUN <<EOF
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y --no-install-recommends git
|
|
|
|
EOF
|
|
|
|
|
|
|
|
RUN <<EOF
|
|
|
|
useradd -s /bin/bash -m vscode
|
|
|
|
groupadd docker
|
|
|
|
usermod -aG docker vscode
|
|
|
|
EOF
|
|
|
|
# install Docker tools (cli, buildx, compose)
|
|
|
|
COPY --from=gloursdocker/docker / /
|