Switch to Postgres.

This commit is contained in:
Jesse Brault 2025-12-25 13:41:53 -06:00
parent 0013d07273
commit fe6784e7fe
3 changed files with 14 additions and 17 deletions

View File

@ -49,7 +49,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
implementation 'org.springframework.boot:spring-boot-starter-jackson'
runtimeOnly 'com.mysql:mysql-connector-j'
runtimeOnly 'org.postgresql:postgresql'
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
testImplementation 'org.springframework.boot:spring-boot-starter-jackson-test'
testImplementation 'org.springframework.security:spring-security-test'

View File

@ -1,26 +1,26 @@
name: meals-made-easy-api-dev
services:
db:
image: mysql:latest
image: pgvector/pgvector:pg18-trixie
ports:
- '55001:3306'
- '55000:33060'
- "5432:5432"
env_file: .env
environment:
MYSQL_DATABASE: meals_made_easy_api
MYSQL_USER: meals-made-easy-api-user
POSTGRES_DB: meals_made_easy_api
POSTGRES_USER: meals-made-easy-api-user
healthcheck:
test: mysqladmin ping -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB
interval: 5s
timeout: 10s
retries: 10
start_period: 10s
volumes:
- mysql-data:/var/lib/mysql
- postgres-data:/var/lib/postgresql
minio:
image: minio/minio:latest
ports:
- 9000:9000
- 9001:9001
- "9000:9000"
- "9001:9001"
env_file:
- .env
environment:
@ -32,8 +32,6 @@ services:
- /data
- --console-address
- :9001
profiles:
- deps
volumes:
mysql-data:
postgres-data:
minio-data:

View File

@ -1,9 +1,8 @@
spring.application.name=meals-made-easy-api
spring.jpa.hibernate.ddl-auto=create-drop
spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/${MYSQL_DATABASE:meals_made_easy_api}
spring.datasource.username=${MYSQL_USERNAME:meals-made-easy-api-user}
spring.datasource.password=${MYSQL_PASSWORD}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:postgresql://${POSTGRES_HOST:localhost}:${POSTGRES_PORT:5432}/${POSTGRES_DB:meals_made_easy_api}
spring.datasource.username=${POSTGRES_USER:meals-made-easy-api-user}
spring.datasource.password=${POSTGRES_PASSWORD}
app.mealsmadeeasy.api.baseUrl=http://localhost:8080
app.mealsmadeeasy.api.security.access-token-lifetime=60
app.mealsmadeeasy.api.security.refresh-token-lifetime=3600