Make sure you have the following installed:
- Java: JDK 1.17 or higher
- Maven: Maven 3.6.3
- Postgres : Postgres
Alternatively you can use Docker
First you have to change the spring.datasource.username and the spring.datasource.password in the application.properties file. If you changed the properties of the postgres db, you also have to change spring.datasource.url.
mvn install
in the folder of the project. Go to the target folder and run
java -jar crossword-service-0.0.1-SNAPSHOT.jar
Start all dependencies with our docker-compose files. Check the manual for docker-compose.
Build the Docker container with
docker build -t overworld-backend-dev .
And run it at port 8000 with
docker run -d -p 8000:80 -e POSTGRES_URL="postgresql://host.docker.internal:5432/postgres" -e POSTGRES_USER="postgres" -e POSTGRES_PASSWORD="postgres" --name overworld-backend-dev overworld-backend-dev
To monitor, stop and remove the container you can use the following commands:
docker ps -a -f name=overworld-backend-dev
docker stop overworld-backend-dev
docker rm overworld-backend-dev
To run the prebuild container use
docker run -d -p 8000:80 -e POSTGRES_URL="postgresql://host.docker.internal:5432/postgres" -e POSTGRES_USER="postgres" -e POSTGRES_PASSWORD="postgres" --name overworld-backend ghcr.io/gamify-it/overworld-backend:latest
to setup a database with docker for testing you can use
docker run -d -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres --rm --name overworld-database postgres
To stop and remove it simply type
docker stop overworld-database