PV281 Semestal project at FI MUNI
Ensure you have docker and docker-compose installed.
For local development and successful build, you must have GStreamer installed.
If you want to add data from an existing database into the released application, add the resources by copying them into the docker/erotic-hub/data/ folder. Add the database dump into the docker/postgres/db-data folder. Use this command to create such a dump:
docker exec -t erotic-hub-db-1 pg_dump -U postgres -d erotic-hub --column-inserts --create > docker/postgres/db-data/dump2.sqlBefore running the application, set up the environmental variables accordingly. You can copy either of these files:
If you set SEED_DATA=true, you have to copy the resources from seed_resources to docker/erotic-hub/data/.
Use the docker compose script to run the application:
cp .env.release-with-seed .env
cp -r seed_resources/. docker/erotic-hub/data/
docker compose --profile release up -dThe app should now run at http://localhost:8000/.
cp .env.release-without-seed .env
docker compose --profile release up -dThe app should now run at http://localhost:8000/.
In development mode, the EroticHub container is not built and created.
- Start all docker services
docker compose --profile dev up -d- Set up environmental variables. You can use the example file:
cp .env.dev .env- Create the database
sqlx database create- Run migrations
sqlx migrate run- Prepare seed data
cp -r seed_resources/ resources/- Run the application
cargo runThe app should now run at http://localhost:8000/.
You can access the database through the Adminer running at http://localhost:8080/.
Important!!! After you update repositories, add migration, or add other SQLx commands, you must run following command to generate offline SQLx files. Otherwise, it's not possible to release the EroticHub! Following command creates files in the .sqlx folder, don't forget to commit them!
cargo sqlx prepare