mirror of
https://github.com/PrivateCaptcha/PrivateCaptcha.git
synced 2026-02-08 14:59:25 -06:00
92 lines
2.6 KiB
YAML
92 lines
2.6 KiB
YAML
services:
|
|
testserver:
|
|
build:
|
|
context: ..
|
|
dockerfile: ./docker/Dockerfile.test
|
|
args:
|
|
GIT_COMMIT: '${GIT_COMMIT}'
|
|
EXTRA_BUILD_FLAGS: '-tags enterprise'
|
|
ports:
|
|
- 8080:8080
|
|
environment:
|
|
TEST_NAME: '${TEST_NAME}'
|
|
STAGE: test
|
|
PC_PORT: 8080
|
|
PC_POSTGRES: postgres://captchasrv:QMS0fJmTHS8Gzq@postgres:5432/privatecaptcha?sslmode=disable&search_path=backend
|
|
PC_USER_FINGERPRINT_KEY: ea3ad6863f0ba598c01bb561eda18c24fa72b75629baed833fb92a7fde29a5dd3ce1cbd466e5c0a2762034b43127bb11a4dd86f1c8ea3c24ea70da21f5b2201c
|
|
PC_RATE_LIMIT_HEADER: X-REAL-IP
|
|
PC_REGISTRATION_ALLOWED: 1
|
|
PC_CLICKHOUSE_OPTIONAL: "true"
|
|
# PC_VERBOSE: 1
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
networks:
|
|
- test_postgres_network
|
|
|
|
migration:
|
|
build:
|
|
context: ..
|
|
dockerfile: ./docker/Dockerfile.test
|
|
args:
|
|
GIT_COMMIT: '${GIT_COMMIT}'
|
|
EXTRA_BUILD_FLAGS: '-tags enterprise'
|
|
command:
|
|
/app/bin/server -mode migrate -migrate-hash $GIT_COMMIT
|
|
environment:
|
|
PC_POSTGRES: postgres://postgres:postgres@postgres:5432/privatecaptcha?sslmode=require&search_path=public
|
|
PC_VERBOSE: true
|
|
PC_CLICKHOUSE_OPTIONAL: "true"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
networks:
|
|
- test_postgres_network
|
|
|
|
vetsqlc:
|
|
image: sqlc/sqlc
|
|
pull_policy: if_not_present
|
|
command:
|
|
vet
|
|
environment:
|
|
PC_POSTGRES: postgres://captchasrv:QMS0fJmTHS8Gzq@postgres:5432/privatecaptcha?sslmode=require&search_path=public
|
|
SQLCDEBUG: dumpvetenv=1
|
|
working_dir: /src
|
|
volumes:
|
|
- ../pkg/db:/src
|
|
depends_on:
|
|
migration:
|
|
condition: service_completed_successfully
|
|
networks:
|
|
- test_postgres_network
|
|
|
|
postgres:
|
|
image: postgres:18
|
|
pull_policy: if_not_present
|
|
command: >
|
|
-c ssl=on
|
|
-c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
|
|
-c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
|
|
-c log_statement=all
|
|
-c log_destination=stderr
|
|
environment:
|
|
POSTGRES_DB: privatecaptcha
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
healthcheck:
|
|
test: pg_isready -U postgres -d privatecaptcha
|
|
interval: 3s
|
|
timeout: 3s
|
|
retries: 3
|
|
networks:
|
|
- test_postgres_network
|
|
volumes:
|
|
- test_postgres_data_volume:/var/lib/postgresql/18/data
|
|
- ../pkg/db/migrations/init/postgres.sh:/docker-entrypoint-initdb.d/myinit.sh
|
|
|
|
networks:
|
|
test_postgres_network:
|
|
|
|
volumes:
|
|
test_postgres_data_volume:
|