docker-compose.yml•7.19 kB
name: prisma-prisma
# For connection urls to the following instances, see
# https://github.com/prisma/prisma/blob/main/TESTING.md#environment-variables
services:
postgres:
build:
context: ./postgres_ext
args:
POSTGRES_VERSION: 12
restart: unless-stopped
# Uncomment the following line to enable query logging
# Then restart the container.
# command: ['postgres', '-c', 'log_statement=all']
environment:
- POSTGRES_DB=tests
- POSTGRES_USER=prisma
- POSTGRES_PASSWORD=prisma
ports:
- '5432:5432'
healthcheck:
# specifying user and database is needed to avoid `FATAL: role "root" does not exist`
# spam in the logs
test: ['CMD', 'pg_isready', '-U', 'prisma', '-d', 'tests']
interval: 5s
timeout: 2s
retries: 20
postgres-16:
build:
context: ./postgres_ext
args:
POSTGRES_VERSION: 16
restart: unless-stopped
# Uncomment the following line to enable query logging
# Then restart the container.
# command: ['postgres', '-c', 'log_statement=all']
environment:
- POSTGRES_DB=tests
- POSTGRES_USER=prisma
- POSTGRES_PASSWORD=prisma
ports:
- '15432:5432'
healthcheck:
# specifying user and database is needed to avoid `FATAL: role "root" does not exist`
# spam in the logs
test: ['CMD', 'pg_isready', '-U', 'prisma', '-d', 'tests']
interval: 5s
timeout: 2s
retries: 20
postgres_isolated:
image: postgres:10
restart: unless-stopped
environment:
- POSTGRES_DB=tests
- POSTGRES_USER=prisma
- POSTGRES_PASSWORD=prisma
ports:
- '5435:5432'
healthcheck:
test: ['CMD', 'pg_isready']
interval: 5s
timeout: 2s
retries: 20
cockroachdb:
image: prismagraphql/cockroachdb-custom:23.1
restart: unless-stopped
command: start-single-node --insecure
ports:
- '26257:26257'
healthcheck:
test: ['CMD', 'curl', '-f', 'http://127.0.0.1:8080/health?ready=1']
interval: 5s
timeout: 2s
retries: 20
# Planetscale
# From https://github.com/prisma/prisma-engines/blob/976a00ae3c30ab9507fa742986c9c6f5327ba10f/docker-compose.yml
vitess-8:
image: vitess/vttestserver:mysql80@sha256:22c9945888fd6d5b192072895db91a1c0357f6ed932993d04689c716cf828bb2
restart: unless-stopped
ports:
- 33807:33807
environment:
PORT: '33804' # unused in testing, but required by vttestserver
KEYSPACES: 'unsharded' # unused in testing, but required by vttestserver
NUM_SHARDS: '1' # unused in testing, but required by vttestserver
MYSQL_BIND_HOST: '0.0.0.0'
FOREIGN_KEY_MODE: 'disallow'
MYSQL_MAX_CONNECTIONS: 100000
TABLET_REFRESH_INTERVAL: '1s'
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h127.0.0.1', '-P33807']
interval: 5s
timeout: 2s
retries: 20
mysql:
image: mysql:9.0
command: --lower_case_table_names=1
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=tests
- MYSQL_USER=prisma # not used
- MYSQL_PASSWORD=prisma
ports:
- '3306:3306'
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h127.0.0.1', '-P3306']
interval: 5s
timeout: 2s
retries: 20
mysql_isolated:
image: mysql:9.0
command: --lower_case_table_names=1
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=tests
- MYSQL_USER=prisma # not used
- MYSQL_PASSWORD=prisma
ports:
- '3307:3306'
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h127.0.0.1', '-P3306']
interval: 5s
timeout: 2s
retries: 20
mariadb:
image: mariadb:10
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=tests
- MYSQL_USER=prisma # not used
- MYSQL_PASSWORD=prisma
ports:
- '4306:3306'
healthcheck:
test: ['CMD', '/usr/local/bin/healthcheck.sh', '--connect']
interval: 5s
timeout: 2s
retries: 20
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
restart: unless-stopped
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=Pr1sm4_Pr1sm4
ports:
- '1433:1433'
healthcheck:
test: ['CMD', '/opt/mssql-tools18/bin/sqlcmd', '-C', '-Usa', '-PPr1sm4_Pr1sm4', '-Q', 'select 1']
interval: 5s
timeout: 2s
retries: 20
mongodb_migrate:
image: mongo:4
restart: unless-stopped
environment:
MONGO_INITDB_DATABASE: tests-migrate
ports:
- '27017:27017'
healthcheck:
# Use "mongo" instead of "mongosh" before v5.0
test: ['CMD', 'mongo', 'admin', '--port', '27017', '--eval', "db.adminCommand('ping').ok"]
interval: 5s
timeout: 2s
retries: 20
start_period: 20s
volumes:
- ./mongodb_migrate_seed:/mongodb_migrate_seed
- ./mongodb_migrate_seed:/docker-entrypoint-initdb.d
# This config is for MongoDB v4
# It's a Replica Set (required for Prisma Client)
mongo:
build:
context: ./mongodb_replica
args:
MONGO_VERSION: 4
environment:
MONGO_REPLICA_HOST: 127.0.0.1
MONGO_REPLICA_PORT: 27018
# Use "mongo" instead of "mongosh" before v5.0
MONGO_COMMAND: 'mongo'
ports:
- '27018:27018'
restart: unless-stopped
healthcheck:
# Use "mongo" instead of "mongosh" before v5.0
test: ['CMD', 'mongo', 'admin', '--port', '27018', '--eval', "db.adminCommand('ping').ok"]
interval: 5s
timeout: 2s
retries: 20
# -> only used for manual testing locally
# This config is for MongoDB v5+
# It's a Replica Set (required for Prisma Client)
mongo6:
build:
context: ./mongodb_replica
args:
MONGO_VERSION: 6
environment:
MONGO_REPLICA_HOST: 127.0.0.1
MONGO_REPLICA_PORT: 27019
# Use "mongo" instead of "mongosh" before v5.0
MONGO_COMMAND: 'mongosh'
ports:
- '27019:27019'
restart: unless-stopped
healthcheck:
# Use "mongo" instead of "mongosh" before v5.0
test: ['CMD', 'mongosh', 'admin', '--port', '27019', '--eval', "db.adminCommand('ping').ok"]
interval: 5s
timeout: 2s
retries: 20
neon_wsproxy:
image: ghcr.io/neondatabase/wsproxy:latest
environment:
APPEND_PORT: 'postgres-16:5432'
ALLOW_ADDR_REGEX: '.*'
LOG_TRAFFIC: 'true'
LOG_CONN_INFO: 'true'
ports:
- '5488:80'
depends_on:
- postgres-16
restart: unless-stopped
healthcheck:
test: ['CMD', 'nc', '-z', '127.0.0.1', '80']
interval: 5s
timeout: 2s
retries: 20
planetscale_proxy:
build: ./planetscale_proxy
environment:
MYSQL_HOST: 'vitess-8' # docker url
MYSQL_PORT: 33807
MYSQL_DATABASE: 'test-0000-00000000'
ports:
- '8085:8085'
depends_on:
- vitess-8
restart: unless-stopped
healthcheck:
test: ['CMD', 'nc', '-z', '127.0.0.1', '8085']
interval: 5s
timeout: 2s
retries: 20