This template can be used to have 4 services locally:
- frontend React
- backend python
- redis
- mysql
In production, you build the frontend and serve it through a s3_bucket. The backend runs within docker on a machine. The database and redis can be run on the same machine as the backend or different machines and connected. You Just change the env variables.
docker-compose build
docker-compose up
For the truly adventurous and lazy:
docker-compose up --build --force-recreate --renew-anon-volumes
The frontend will be on: http://127.0.0.1:3007
The backend will be on: http://127.0.0.1:5004
You can test this by going to: http://127.0.0.1:5004/ping
You might also want to ssh into the machine, you can do that with:
docker-compose exec api /bin/bash
or you may want to access a python shell with the db already connected to play around:
docker-compose exec api python manage.py shell
The local DB will be on: http://127.0.0.1:3307
If you want to access the mysql shell:
docker-compose exec api-db mysql --password=mysql api_dev
Adminer will be on: http://127.0.0.1:8080/?server=api-db&username=mysql&db=api_dev
With password=mysql
The salted password with "$2b$04$8soYgayLjwuTx5mzLIAmWuFWtzkptaJiLDjqzN3S9f9mmQkdgWIAC"
Is from password="password", use that to access any of the default accounts
Redis will be on: http://127.0.0.1:6379