This repo has the common backend and frontend technologies dockerized to start a new project without the concerns of installations or connexion between technologies.
- django
- djangorestframework
- djangorestframework-jwt
- django-cors-headers
- postgres
- react
- react-bootstrap
- axios
- react-router-dom
Note: It has CORS integration and jwt for authentication. To test this integration the project contains a CheckList app.
-
Create a proxy network where the containers will connect
docker network create proxy
-
Run jwilder/nginx-proxy container
docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro --restart=always --name proxy --network proxy jwilder/nginx-proxy
-
Add the hosts for frontend and backend containers
3.1 In your console enter to hosts file with write permissions
nano /etc/hosts
3.2 Add these two lines
127.0.0.1 backend.test 127.0.0.1 frontend.test
3.3 Restart the proxy container
docker restart proxy
-
Build images and run containers
make start
-
Finally run the backend migrations
make docker-migrate-up
make start
make docker-test