diff --git a/Dockerfile b/Dockerfile index 980050b..241793e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,11 @@ -# See https://hub.docker.com/r/tiangolo/uwsgi-nginx-flask/ -FROM tiangolo/uwsgi-nginx-flask:python3.11 +FROM tiangolo/meinheld-gunicorn-flask:python3.9 + +# See https://hub.docker.com/r/tiangolo/meinheld-gunicorn-flask/ +# Note Python3.9 is used for compatibility. This image is actively +# maintained. + +# Alternatively +# FROM tiangolo/uwsgi-nginx-flask:python3.11 # Build args ARG VERSION @@ -19,8 +25,6 @@ COPY ./app /app ENV PORT=80 ENV VERSION=$VERSION -#CMD pipenv run gunicorn --bind 0.0.0.0:8000 --timeout 120 --workers 2 cbwg.wsgi - # Use this CMD to only run the python app #CMD pipenv run python /app/main.py # Or this CMD if the requirements have been 'pip install'ed. diff --git a/Dockerfile-nginx b/Dockerfile-nginx deleted file mode 100644 index 9955207..0000000 --- a/Dockerfile-nginx +++ /dev/null @@ -1,20 +0,0 @@ -# See https://hub.docker.com/r/tiangolo/uwsgi-nginx-flask/ -FROM tiangolo/uwsgi-nginx-flask:python3.11 - -# Build args -ARG VERSION - -# Working Directory -# WORKDIR /app - -# Install packages from requirements.txt -COPY requirements.txt /app/requirements.txt -RUN pip install --no-cache-dir --upgrade pip &&\ - pip install --no-cache-dir --trusted-host pypi.python.org -r requirements.txt - -# Copy source code to working directory -COPY ./app /app - -# Default env vars -ENV PORT=80 -ENV VERSION=$VERSION diff --git a/Dockerfile-no-nginx b/Dockerfile-no-nginx deleted file mode 100644 index 17d3a14..0000000 --- a/Dockerfile-no-nginx +++ /dev/null @@ -1,21 +0,0 @@ -# Base Image -FROM python:3.11-slim-bullseye - -# Build args -ARG VERSION - -# Working Directory -WORKDIR /app - -# Install packages from requirements.txt -COPY requirements.txt /app/requirements.txt -RUN pip install --no-cache-dir --upgrade pip &&\ - pip install --no-cache-dir --trusted-host pypi.python.org -r requirements.txt - -# Copy source code to working directory -COPY ./app /app - -# Default env vars and command. -ENV PORT=5000 -ENV VERSION=$VERSION -CMD ["python", "/app/main.py"] diff --git a/PRODUCTION.md b/PRODUCTION.md index 56fc42f..087c654 100644 --- a/PRODUCTION.md +++ b/PRODUCTION.md @@ -45,6 +45,12 @@ Probably required for HTTP/2 ## Docker test +``` +% docker build -t building-docker-containers . +% docker run -p 8080:80 building-docker-containers:latest +``` + + When running Docker locally it's likely you will create a lot of test containers. To remove all stopped containers. ``` % docker container prune