awesome-compose/flask-redis/Dockerfile
Milas Bowman b53e4542c9
flask-redis: dev envs support & misc improvements (#265)
(Most of this is almost identical to #263.)

* Docker Desktop Development Environments config
* Use cache volumes for pip
* Downgrade from Python 3.11 _alpha_ -> Python 3.10
* Use port `8000` to avoid conflicts with Airplay on
    macOS for default Flask port `5000`
* Use `SIGINT` to gracefully stop Flask
* Formatting fixes in `compose.yaml`

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-07-08 16:48:08 +02:00

28 lines
513 B
Docker

# syntax=docker/dockerfile:1.4
FROM --platform=$BUILDPLATFORM python:3.10-alpine AS builder
WORKDIR /code
COPY requirements.txt /code
RUN --mount=type=cache,target=/root/.cache/pip \
pip3 install -r requirements.txt
COPY . /code
ENTRYPOINT ["python3"]
CMD ["app.py"]
FROM builder as dev-envs
RUN <<EOF
apk update
apk add git bash
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 / /