Commit 97fc2d6e authored by Romain Loth's avatar Romain Loth

first docker compose script for future mysql db (TODO add a doors container to this config too)

parent 7c3a74ac
......@@ -39,6 +39,23 @@ The form server is now accessible locally on `127.0.0.1:9090/regcomex`
(the default ROUTE_PREFIX is /regcomex, but TODO can be changed in config file)
#### Running via docker
Prerequisites:
- `docker`
- `docker-compose` (>= v. 1.7.0)
```
cd setup/dockers
docker build flask_ispcif_light/ -t flask_ispcif_light:latest
docker run -p 9090 --name comex_flask_test flask_ispcif_light
# run the app + mysql (TODO actually use mysql!)
docker-compose up
```
#### Running in prod
Secondly we ask nginx to reverse-proxy our app
......
```bash
docker build flask_ispcif_light/ -t flask_ispcif_light:latest
docker run -p 9090 --name comex_flask_test flask_ispcif_light
#docker run -it -p 9090 --name comex_flask_test flask_ispcif_light
# check ports redirection
docker inspect comex_flask_test | jq '.[0].NetworkSettings'
```
```
# check ports redirection
# docker inspect comex_flask_test | jq '.[0].NetworkSettings'
# docker exec -it comex_flask_test bash
```
# NB this config assumes we have already built flask_ispcif_light
version: '2'
services:
mysql:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=very-safe-pass
flask_ispcif_light:
# todo simplify path
image: flask_ispcif_light
environment:
- HOST=0.0.0.0 # will bind the server to this address
- DEBUG_FLAG=true
ports:
- "9090:32790"
# volumes:
# - .:/code
depends_on:
- mysql
# - doors
# doors:
# image: doors
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment