|
|
|
version: "3.4"
|
|
|
|
|
|
|
|
x-global:
|
|
|
|
user: &user
|
|
|
|
"${DOCKER_UID:-1000}:${DOCKER_GID:-1000}"
|
|
|
|
|
|
|
|
networks:
|
|
|
|
u_net:
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
|
|
|
u_server:
|
|
|
|
user: *user
|
|
|
|
image: localhost/unki/u_server
|
|
|
|
networks:
|
|
|
|
- u_net
|
|
|
|
volumes:
|
|
|
|
- ../target/x86_64-unknown-linux-musl/${PROFILE:-debug}/u_server:/unki/u_server
|
|
|
|
- ../logs:/unki/logs:rw
|
|
|
|
working_dir: /unki
|
|
|
|
command: /unki/u_server
|
|
|
|
depends_on:
|
|
|
|
u_db:
|
|
|
|
condition: service_healthy
|
|
|
|
ports:
|
|
|
|
- 9990:9990
|
|
|
|
env_file:
|
|
|
|
- ../.env
|
|
|
|
- ../.env.private
|
|
|
|
environment:
|
|
|
|
RUST_LOG: warp=info,u_server_lib=debug,u_lib=debug
|
|
|
|
healthcheck:
|
|
|
|
test: ss -tlpn | grep 9990
|
|
|
|
interval: 5s
|
|
|
|
timeout: 2s
|
|
|
|
retries: 2
|
|
|
|
|
|
|
|
u_db:
|
|
|
|
image: localhost/unki/u_db
|
|
|
|
networks:
|
|
|
|
- u_net
|
|
|
|
ports:
|
|
|
|
- 54321:5432
|
|
|
|
env_file:
|
|
|
|
- ../.env
|
|
|
|
- ../.env.private
|
|
|
|
volumes:
|
|
|
|
- ../target/x86_64-unknown-linux-musl/${PROFILE:-debug}/migrator:/migrator
|
|
|
|
- type: bind
|
|
|
|
source: ../scripts/u_db_entrypoint.sh
|
|
|
|
target: /u_db_entrypoint.sh
|
|
|
|
command: /u_db_entrypoint.sh
|
|
|
|
healthcheck:
|
|
|
|
# test if db's port is open and db is created
|
|
|
|
test: ss -tlpn | grep 5432 && psql -lqt -U $${POSTGRES_USER} | grep -qw $${POSTGRES_DATABASE}
|
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 3
|
|
|
|
|
|
|
|
u_agent:
|
|
|
|
user: *user
|
|
|
|
image: localhost/unki/u_agent
|
|
|
|
networks:
|
|
|
|
- u_net
|
|
|
|
volumes:
|
|
|
|
- ../target/x86_64-unknown-linux-musl/${PROFILE:-debug}/u_agent:/unki/u_agent
|
|
|
|
- ../logs:/unki/logs:rw
|
|
|
|
working_dir: /unki
|
|
|
|
command: bash -c "/unki/u_agent u_server; sleep 3600"
|
|
|
|
env_file:
|
|
|
|
- ../.env
|
|
|
|
environment:
|
|
|
|
RUST_LOG: u_agent=debug,u_lib=debug
|
|
|
|
depends_on:
|
|
|
|
u_server:
|
|
|
|
condition: service_healthy
|
|
|
|
|
|
|
|
tests_runner:
|
|
|
|
user: *user
|
|
|
|
image: localhost/unki/tests_runner
|
|
|
|
networks:
|
|
|
|
- u_net
|
|
|
|
volumes:
|
|
|
|
- ${HOME}/.cargo/registry/:/usr/local/cargo/registry/
|
|
|
|
- ../__Cargo_integration.toml:/tests/Cargo.toml
|
|
|
|
- ./:/tests/integration-tests/
|
|
|
|
- ../certs:/tests/certs
|
|
|
|
- ../target/x86_64-unknown-linux-musl/${PROFILE:-debug}/u_panel:/u_panel
|
|
|
|
- ../lib/u_lib:/tests/lib/u_lib
|
|
|
|
- ../logs:/tests/integration-tests/logs:rw
|
|
|
|
working_dir:
|
|
|
|
/tests/integration-tests/
|
|
|
|
depends_on:
|
|
|
|
u_agent:
|
|
|
|
condition: service_started
|
|
|
|
u_server:
|
|
|
|
condition: service_healthy
|
|
|
|
env_file:
|
|
|
|
- ../.env
|
|
|
|
- ../.env.private
|
|
|
|
environment:
|
|
|
|
RUST_BACKTRACE: 1
|
|
|
|
RUST_LOG: hyper=info,reqwest=info
|
|
|
|
U_SERVER: u_server
|