direnv / process-compose
This commit is contained in:
parent
c3093f1030
commit
5d7606f471
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ node_modules
|
||||
dist
|
||||
*.env
|
||||
.pgdata
|
||||
.direnv
|
||||
|
||||
55
process-compose.yaml
Normal file
55
process-compose.yaml
Normal file
@ -0,0 +1,55 @@
|
||||
version: "0.5"
|
||||
|
||||
environment:
|
||||
- "PGDATA=.pgdata"
|
||||
- "PGHOST=.pgdata"
|
||||
- "DATABASE_URL=postgresql:///annotatemap?host=${PWD}/.pgdata"
|
||||
|
||||
processes:
|
||||
postgres-init:
|
||||
command: |
|
||||
if [ ! -f .pgdata/PG_VERSION ]; then
|
||||
initdb -D .pgdata
|
||||
fi
|
||||
availability:
|
||||
restart: "no"
|
||||
|
||||
postgres:
|
||||
command: postgres -D .pgdata -k "$PWD/.pgdata" -c listen_addresses=
|
||||
depends_on:
|
||||
postgres-init:
|
||||
condition: process_completed_successfully
|
||||
readiness_probe:
|
||||
exec:
|
||||
command: pg_isready -h "$PWD/.pgdata"
|
||||
initial_delay_seconds: 1
|
||||
period_seconds: 1
|
||||
|
||||
db-setup:
|
||||
command: |
|
||||
createdb -h "$PWD/.pgdata" annotatemap 2>/dev/null || true
|
||||
psql -h "$PWD/.pgdata" annotatemap < server/src/schema.sql
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: process_healthy
|
||||
availability:
|
||||
restart: "no"
|
||||
|
||||
shared-build:
|
||||
command: npm run build --workspace=shared
|
||||
availability:
|
||||
restart: "no"
|
||||
|
||||
server:
|
||||
command: npm run dev:server
|
||||
depends_on:
|
||||
db-setup:
|
||||
condition: process_completed_successfully
|
||||
shared-build:
|
||||
condition: process_completed_successfully
|
||||
|
||||
client:
|
||||
command: npm run dev:client
|
||||
depends_on:
|
||||
shared-build:
|
||||
condition: process_completed_successfully
|
||||
Loading…
x
Reference in New Issue
Block a user