Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s-rb/blog-backend
Backend appliction for a blog
https://github.com/s-rb/blog-backend
Last synced: 24 days ago
JSON representation
Backend appliction for a blog
- Host: GitHub
- URL: https://github.com/s-rb/blog-backend
- Owner: s-rb
- Created: 2024-04-13T16:06:55.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-06-23T21:30:46.000Z (7 months ago)
- Last Synced: 2024-11-05T21:16:53.080Z (2 months ago)
- Language: Java
- Size: 52.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Backend application for a blog
## Technologies:
- Java 21,
- Springboot 3 (Web, Data-JPA)
- Postgres 14
- Docker, compose
- Gradle
- LombokVariables are set using .env files through docker-compose.
In docker-compose, this is handled by the env_file or environment section.
Docker-compose-test also starts its own database, an external database is provided for production and this container is missing.
To use in testing, you need to:
- set variables in the .env.test file
- first you need to build application ```./gradlew clean build```
- then start with the command ```docker-compose -f docker-compose-test.yml up -d --force-recreate --build```
- check in the browser by calling the helloController - GET request at the address ```http://localhost:8081/hello or http://localhost:8081/hello?name=myname```
- stop with the command ```docker-compose -f docker-compose-test.yml down```
If you want to use docker-compose-prod without db container - you can execute
```docker-compose -f docker-compose-prod.yml up -d --force-recreate --build```## .env properties:
- SERVER_HOST=localhost
- SERVER_PORT=8081
- DB_HOST=blog-db
- DB_PORT=5432
- DB_NAME=blog
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_OPTIONS=