This is a Python Flask Quickstart for Nullstone. This is based on the Flask official quickstart guide.
This uses the Nullstone official nullstone/flask image.
- Create a public web app. (Remember
app-name
for later) - Add the
SECRET_KEY for Flask Cookies
capability to the app. - Provision
nullstone up --wait --block=<app-name> --env=<env-name>
- Build, push, and deploy
docker build -t flask-app .
nullstone launch --source=flask-app --app=<app-name> --env=<env-name>
You can run this project locally inside Docker or using elixir alone.
To use docker, this project contains docker-compose.yml
that runs with MIX_ENV=dev
.
This setup ensures that using Docker doesn't inhibit typical development workflows:
- Hot reload is configured so that changes to the app doesn't require a reboot
- Dependencies are installed on boot of docker container
FLASK_DEBUG
is set to enable the debugger.
docker compose up
Visit http://localhost:9000.
The app
in docker-compose.yml
is configured to run flask in debug mode.
You do not need to rebuild/restart the flask app when making changes to code.
Any time you change requirements.txt
, you need to update your dependencies.
The dependencies will be installed on boot of the docker container; restart the container to update.
docker compose restart app