Skip to content

Commit

Permalink
no nginx - try me with https
Browse files Browse the repository at this point in the history
  • Loading branch information
msaunby committed Jun 12, 2023
1 parent ab25ae6 commit 2c1107c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# See https://hub.docker.com/r/tiangolo/uwsgi-nginx-flask/
FROM tiangolo/uwsgi-nginx-flask:python3.11
# Base Image
FROM python:3.11-slim-bullseye

# Build args
ARG VERSION

# Working Directory
# WORKDIR /app
WORKDIR /app

# Install packages from requirements.txt
COPY requirements.txt /app/requirements.txt
Expand All @@ -15,6 +15,7 @@ RUN pip install --no-cache-dir --upgrade pip &&\
# Copy source code to working directory
COPY ./app /app

# Default env vars
ENV PORT=80
# Default env vars and command.
ENV PORT=5000
ENV VERSION=$VERSION
CMD ["python", "/app/main.py"]
20 changes: 20 additions & 0 deletions Dockerfile-nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def home():

if __name__ == "__main__":
port = os.environ.get('PORT')
app.run(host='0.0.0.0', port=port)
app.run(host='0.0.0.0', port=port, ssl_context='adhoc')
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
wheel
flask
pyopenssl

0 comments on commit 2c1107c

Please sign in to comment.