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
13 changes: 9 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export SECRET_KEY=insecure_key_for_dev
# Which environment is running?
# For Flask, it should be: "true" or "false"
# For Node, it should be: "development" or "production"
#
# Debug mode enables Flask / Werkzeug development tooling. Keep the web service
# bound to localhost when using it, and don't expose it to untrusted networks.
#export FLASK_DEBUG=false
#export NODE_ENV=production
export FLASK_DEBUG=true
Expand Down Expand Up @@ -102,10 +105,12 @@ export DOCKER_WEB_HEALTHCHECK_TEST=/bin/true
# Use the default in production to avoid having gunicorn directly accessible on
# the internet since it'll very likely be behind nginx or a load balancer.
#
# This is being overwritten in dev to be compatible with more dev environments,
# such as accessing your site on another local device (phone, tablet, etc.).
#export DOCKER_WEB_PORT_FORWARD=127.0.0.1:8000
export DOCKER_WEB_PORT_FORWARD=8000
# Bind to localhost by default so development-only tooling such as the
# Werkzeug debugger isn't exposed to your LAN or the public internet. If you
# need another device to access the app, explicitly change this value and make
# sure debug mode is disabled or the network is trusted.
export DOCKER_WEB_PORT_FORWARD=127.0.0.1:8000
#export DOCKER_WEB_PORT_FORWARD=8000

# What volume path should be used? In dev we want to volume mount everything
# so that we can develop our code without rebuilding our Docker images.
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ cd helloflask
cp .env.example .env
```

The example `.env` enables Flask debug mode for local development. By default
the web port is bound to `127.0.0.1:8000` so the development server and
Werkzeug debugger are only reachable from your machine. If you change
`DOCKER_WEB_PORT_FORWARD` to make the app reachable from another device, avoid
doing that on untrusted networks while debug mode is enabled.

#### Build everything:

*The first time you run this it's going to take 5-10 minutes depending on your
Expand Down