Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.8.5-alpine3.12

LABEL maintainer "@fabdelgado <mail@fabdelgado.com>"
LABEL maintainer="@fabdelgado <mail@fabdelgado.com>"

RUN apk add --no-cache gcc musl-dev linux-headers

Expand All @@ -10,11 +10,10 @@ COPY . /usr/src/app

RUN pip3 install --no-cache-dir -r requirements.txt

ENV PORT 80
ENV FLASK_APP main.py
ENV FLASK_APP=main.py

ENV FLASK_RUN_HOST 0.0.0.0
ENV FLASK_RUN_HOST=0.0.0.0

#prod
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 microblog:app
CMD ["gunicorn", "--bind", ":80", "--workers", "1", "--threads", "8", "--timeout", "0", "microblog:app"]

15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
Multilingual Flask Boilerplate with smart routing optimised for search engines and including separate URL’s for each language.
I created this application as example code for a Medium article which is linked below.

### Build

```
docker build -t flask-gunicorn-app .
docker run -p 80:80 --name multilangapp flask-gunicorn-app
```
Results in:
```
[2025-07-24 16:20:00 +0000] [1] [INFO] Starting gunicorn 23.0.0
[2025-07-24 16:20:00 +0000] [1] [INFO] Listening at: http://0.0.0.0:80 (1)
[2025-07-24 16:20:00 +0000] [1] [INFO] Using worker: gthread
[2025-07-24 16:20:00 +0000] [8] [INFO] Booting worker with pid: 8
```
The website is available at [http://0.0.0.0:80](http://0.0.0.0:80)

### Live Demo
A live demo of the application can be found here:<br>
http://schmidni.pythonanywhere.com/lang10
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Jinja2==2.11.3
MarkupSafe==1.1.1
mccabe==0.6.1
oauthlib==3.1.0
pkg-resources==0.0.0
# pkg-resources==0.0.0
pycodestyle==2.7.0
pyflakes==2.3.0
PyMySQL==1.0.2
Expand All @@ -28,3 +28,4 @@ toml==0.10.2
tweepy==3.10.0
urllib3==1.25.11
Werkzeug==1.0.1
gunicorn==23.0.0