rallly/docker-compose.yml
Trammell Hudson f65fe76863
docker-compose: pass schema to migrate deploy (#182)
This patch passes the explicit path to the prisma schema so
that the initial table creation is performed.  Otherwise the
command will print:

    No migration found in prisma/migrations

And attempting to create a poll produces the postgres error:

    ERROR:  relation "public.users" does not exist at character 35
    STATEMENT:  SELECT "public"."users"."id" FROM "public"."users" WHERE "public"."users"."email" = $1 OFFSET $2

Signed-off-by: Trammell Hudson <hudson@trmm.net>
2022-05-19 20:05:06 +01:00

30 lines
706 B
YAML

version: "3.3"
services:
rallly_db:
image: postgres:14.2
restart: always
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
rallly:
build:
context: .
args:
- DATABASE_URL=postgres://postgres:postgres@rallly_db:5432/db?pgbouncer=true
- NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL}
restart: always
command: sh -c "yarn prisma migrate deploy --schema prisma/schema.prisma && yarn start"
depends_on:
- rallly_db
ports:
- 3000:3000
environment:
- DATABASE_URL=postgres://postgres:postgres@rallly_db:5432/db
env_file:
- .env
volumes:
db-data:
driver: local