Skip to content

winnyboy5/Python_API_Boiler

Repository files navigation

Flask-Docker-Starter

A starter template Docker with FLASK, NGINX & POSTGRES

Development

Uses the default Flask development server.

Rename .env.dev-sample to .env.dev.

Update the environment variables in the docker-compose.yml and .env.dev files.

Build the images and run the containers:

$ docker-compose up -d --build

Test it out at http://localhost:5000. The "web" folder is mounted into the container and your code changes apply automatically.

Production

Uses gunicorn + nginx.

Use .env.prod-sample to .env.prod and .env.prod.db-sample to .env.prod.db. Update the environment variables.

Build the images and run the containers & the DB migration:

$ docker-compose -f docker-compose.prod.yml up -d --build

$ docker-compose -f docker-compose.prod.yml exec web flask db init

$ docker-compose -f docker-compose.prod.yml exec web flask db stamp head

$ docker-compose -f docker-compose.prod.yml exec web flask db migrate

$ docker-compose -f docker-compose.prod.yml exec web flask db update

Test it out at http://localhost:1337. No mounted folders. To apply changes, the image must be re-built.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published