Deployment Code to deploy the web application. After running docker-compose-backend.yml, the containers will be deployed in the following schema:
You need to be logged in via Docker CLI to Github. Tutorial
- Clone the repository
git clone https://github.com/Projekt-DataScience/infrastructure.git
After that you should have docker-compose-backend.yml and example.env locally on your machine.
- Copy the example.env file to
.env
cp example.env .env
Now you should have a .env file
- OPTIONAL: Change environment variables. You can do that by changing the values in .env. But do not change the DB_HOSTNAME environment variable!
- Start the backend with the following command:
docker-compose -f docker-compose-backend.yml up
Or you can also use make:
make start-backend
Currently this command will start the following:
- Database Server on port 5432 (if you have not changed the
DB_PORT
environment variable) - PgAdmin on port 8080
- Audit Service on port 8081
All the data inside the database will be lost
The following commands should be run, if the database structure changed. That happens when new models/tables are added to backend-db-lib or existing models/tables are changed.
docker-compose -f docker-compose-backend.yml rm
docker volume rm infrastructure_manager_volume
docker-compose -f docker-compose-backend.yml pull
docker-compose -f docker-compose-backend.yml up
OR:
make reset-db
This won't delete any data in the database. Stop already running containers of this infrastructure and run the following commands:
docker-compose -f docker-compose-backend.yml pull
docker-compose -f docker-compose-backend.yml up
OR:
make update
git pull
cp example.env .env
docker-compose -f docker-compose-backend.yml up