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-security'
implementation 'org.springframework.boot:spring-boot-starter-webmvc' implementation 'org.springframework.boot:spring-boot-starter-webmvc'
implementation 'org.springframework.boot:spring-boot-starter-jackson' 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-webmvc-test'
testImplementation 'org.springframework.boot:spring-boot-starter-jackson-test' testImplementation 'org.springframework.boot:spring-boot-starter-jackson-test'
testImplementation 'org.springframework.security:spring-security-test' testImplementation 'org.springframework.security:spring-security-test'

View File

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

View File

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