composr
This commit is contained in:
parent
9039f00ed0
commit
bf925c0ca8
@ -3,64 +3,19 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: spomeniqr-app
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD:-postgres}@db:5432/monuments
|
- DATABASE_URL=${DATABASE_URL}
|
||||||
- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=${NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY}
|
- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=${NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY}
|
||||||
- CLERK_SECRET_KEY=${CLERK_SECRET_KEY}
|
- CLERK_SECRET_KEY=${CLERK_SECRET_KEY}
|
||||||
- NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL:-https://testbed.mk}
|
- NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL}
|
||||||
- NEXT_PUBLIC_APP_DOMAIN=${NEXT_PUBLIC_APP_DOMAIN:-testbed.mk}
|
- NEXT_PUBLIC_APP_DOMAIN=${NEXT_PUBLIC_APP_DOMAIN}
|
||||||
|
- NEXT_PUBLIC_CLERK_SIGN_IN_URL=${NEXT_PUBLIC_CLERK_SIGN_IN_URL}
|
||||||
|
- NEXT_PUBLIC_CLERK_SIGN_UP_URL=${NEXT_PUBLIC_CLERK_SIGN_UP_URL}
|
||||||
|
- NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=${NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL}
|
||||||
|
- NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=${NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL}
|
||||||
- S3_ENDPOINT=${S3_ENDPOINT}
|
- S3_ENDPOINT=${S3_ENDPOINT}
|
||||||
- S3_REGION=${S3_REGION:-eu-2}
|
- S3_REGION=${S3_REGION}
|
||||||
- S3_ACCESS_KEY_ID=${S3_ACCESS_KEY_ID}
|
- S3_ACCESS_KEY_ID=${S3_ACCESS_KEY_ID}
|
||||||
- S3_SECRET_ACCESS_KEY=${S3_SECRET_ACCESS_KEY}
|
- S3_SECRET_ACCESS_KEY=${S3_SECRET_ACCESS_KEY}
|
||||||
- S3_BUCKET_NAME=${S3_BUCKET_NAME:-monuments-images}
|
- S3_BUCKET_NAME=${S3_BUCKET_NAME}
|
||||||
depends_on:
|
|
||||||
db:
|
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
|
||||||
- spomeniqr
|
|
||||||
|
|
||||||
db:
|
|
||||||
image: postgres:16-alpine
|
|
||||||
container_name: spomeniqr-db
|
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
|
||||||
POSTGRES_DB: monuments
|
|
||||||
volumes:
|
|
||||||
- pgdata:/var/lib/postgresql/data
|
|
||||||
ports:
|
|
||||||
- "5432:5432"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
networks:
|
|
||||||
- spomeniqr
|
|
||||||
|
|
||||||
nginx:
|
|
||||||
image: nginx:alpine
|
|
||||||
container_name: spomeniqr-nginx
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
- "443:443"
|
|
||||||
volumes:
|
|
||||||
- ./nginx/conf.d:/etc/nginx/conf.d
|
|
||||||
- ./certbot/conf:/etc/letsencrypt
|
|
||||||
- ./certbot/www:/var/www/certbot
|
|
||||||
depends_on:
|
|
||||||
- app
|
|
||||||
networks:
|
|
||||||
- spomeniqr
|
|
||||||
|
|
||||||
networks:
|
|
||||||
spomeniqr:
|
|
||||||
driver: bridge
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
pgdata:
|
|
||||||
@ -1,11 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
|
||||||
|
|
||||||
export HOSTNAME=0.0.0.0
|
export HOSTNAME=0.0.0.0
|
||||||
export PORT=3000
|
export PORT=3000
|
||||||
|
|
||||||
|
echo "=== SpomeniQR Starting ==="
|
||||||
|
echo "DATABASE_URL: ${DATABASE_URL:+set}"
|
||||||
|
echo "CLERK_SECRET_KEY: ${CLERK_SECRET_KEY:+set}"
|
||||||
|
echo "S3_ENDPOINT: ${S3_ENDPOINT:+set}"
|
||||||
|
|
||||||
echo "Running Prisma migrations..."
|
echo "Running Prisma migrations..."
|
||||||
npx prisma migrate deploy
|
node ./node_modules/prisma/build/index.js migrate deploy || {
|
||||||
|
echo "WARNING: Prisma migrations failed, continuing anyway..."
|
||||||
|
}
|
||||||
|
|
||||||
echo "Starting Next.js server on 0.0.0.0:3000..."
|
echo "Starting Next.js server on 0.0.0.0:3000..."
|
||||||
exec node server.js
|
exec node server.js
|
||||||
Loading…
Reference in New Issue
Block a user