demo-docker/README.md

45 lines
1.4 KiB
Markdown
Raw Normal View History

2025-01-16 14:17:25 +01:00
# What is it?
This is just a small Vue.js demo app with a Django Rest API Backend that writes "Todos" to a Postgesql DB.
It serves as demo to on how to setup the containerization with docker.
2025-01-16 19:20:30 +01:00
# How to use/deploy
## Simple Way
Clone the 3 repos into the folder:
2025-01-16 19:40:24 +01:00
* ```mkdir TestProject && cd TestProject```
* ```git clone ssh://git@git.impstyle.com:222/test/demo-docker.git docker```
* ```git clone ssh://git@git.impstyle.com:222/test/demo-fronted.git frontend```
* ```git clone ssh://git@git.impstyle.com:222/test/demo-backend.git backend```
git submodule add git@git.impstyle.com:222/test/demo-frontend.git frontend
git submodule add git@git.impstyle.com:222/test/demo-backend.git backend
2025-01-16 19:20:30 +01:00
## SSH git clone via docker compose
Have a valid ssh key pair with the Git server provider.
2025-01-16 19:50:44 +01:00
2025-01-16 19:20:30 +01:00
adjust the path to the frontend and backend repos inside `docker-compose_ssh_git.yml`
2025-01-16 19:50:44 +01:00
2025-01-16 19:20:30 +01:00
run ```docker compose build -f docker-compose_ssh_git.yml --ssh default```
this path is tricky because you have to do more to make the ssh keys working with the docker compose instance.
## how to start the application
2025-01-16 14:17:25 +01:00
Adjust the .env files.
2025-01-16 19:50:44 +01:00
2025-01-16 14:17:25 +01:00
run: ```docker compose up --build```
2025-01-16 19:50:44 +01:00
2025-01-16 14:17:25 +01:00
run: ```docker-compose exec backend python manage.py createsuperuser``` and create a user in the backend.
2025-01-16 19:50:44 +01:00
2025-01-16 14:17:25 +01:00
the frontend runs on http://localhost:5173
2025-01-16 14:25:12 +01:00
2025-01-16 19:50:44 +01:00
### local dev:
2025-01-16 14:25:12 +01:00
enables live updates of the code during development, no rebuild needed:
2025-01-16 19:50:44 +01:00
2025-01-16 14:25:12 +01:00
```docker-compose -f docker-compose.yml -f docker-compose.override.yml up```