Small change to deploy this nigger
This commit is contained in:
parent
e1c4cf777d
commit
7b32ad5c7c
@ -19,6 +19,18 @@ services:
|
|||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
||||||
|
migrate:
|
||||||
|
image: ${IMAGE_NAME:-junohub-app}:${IMAGE_TAG:-latest}
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-password}@db:5432/${POSTGRES_DB:-dropshipping}?schema=public
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
command: ["npx", "prisma", "migrate", "deploy"]
|
||||||
|
restart: "no"
|
||||||
|
|
||||||
app:
|
app:
|
||||||
# IMPORTANT: EC2 deploy copies only the compose file + env + image tar.
|
# IMPORTANT: EC2 deploy copies only the compose file + env + image tar.
|
||||||
# Do not include `build:` here; otherwise Compose will look for a Dockerfile on EC2.
|
# Do not include `build:` here; otherwise Compose will look for a Dockerfile on EC2.
|
||||||
@ -38,6 +50,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
migrate:
|
||||||
|
condition: service_completed_successfully
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/api/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"]
|
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/api/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|||||||
@ -19,6 +19,21 @@ services:
|
|||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
||||||
|
migrate:
|
||||||
|
image: ${IMAGE_NAME:-junohub-app}:latest
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-password}@db:5432/${POSTGRES_DB:-dropshipping}?schema=public
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
command: ["npx", "prisma", "migrate", "deploy"]
|
||||||
|
restart: "no"
|
||||||
|
|
||||||
app:
|
app:
|
||||||
# Use pre-built image on deploy (EC2 loads tar only; no Dockerfile on server). Local: docker compose up --build
|
# Use pre-built image on deploy (EC2 loads tar only; no Dockerfile on server). Local: docker compose up --build
|
||||||
image: ${IMAGE_NAME:-junohub-app}:latest
|
image: ${IMAGE_NAME:-junohub-app}:latest
|
||||||
@ -43,6 +58,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
migrate:
|
||||||
|
condition: service_completed_successfully
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/api/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"]
|
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/api/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user