feat: Upgrade to Next.js 16 and refactor deployment to use an external database with a simplified Docker Compose setup.
This commit is contained in:
@@ -1,22 +1,4 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
container_name: fikri-portfolio-db
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER:-fikri}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-fikri}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-fullstack-portfolio}
|
||||
ports:
|
||||
- "5429:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-fikri} -d ${POSTGRES_DB:-fullstack-portfolio}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
@@ -27,7 +9,8 @@ services:
|
||||
ports:
|
||||
- "4000:4000"
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER:-fikri}:${POSTGRES_PASSWORD:-fikri}@host.docker.internal:5429/${POSTGRES_DB:-fullstack-portfolio}?schema=public
|
||||
# Aplikasi akan langsung menggunakan DATABASE_URL dari file .env (pointing ke DB existing Anda)
|
||||
DATABASE_URL: ${DATABASE_URL}
|
||||
JWT_SECRET: ${JWT_SECRET}
|
||||
R2_TOKEN: ${R2_TOKEN}
|
||||
R2_ACCESS_KEY: ${R2_ACCESS_KEY}
|
||||
@@ -35,13 +18,7 @@ services:
|
||||
R2_ENDPOINT: ${R2_ENDPOINT}
|
||||
R2_BUCKET_NAME: ${R2_BUCKET_NAME}
|
||||
IMAGE_URL: ${IMAGE_URL}
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
command: >
|
||||
sh -c "npx prisma migrate deploy && node server.js"
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
Reference in New Issue
Block a user