services: server: #image: docker.io/valentincolin/smart-fridge-server:2.0.0 image: smart-fridge-server-test:2.0.0 build: context: . dockerfile: Dockerfile target: runner depends_on: db: condition: service_healthy ports: - 9000:80 environment: &env_server DATABASE_ADDR: db # name of the service holding the database #DATABASE_NAME: ${DATABASE_NAME:-postgres} #DATABASE_USERNAME: ${DATABASE_USERNAME:-postgres} DATABASE_PASSWORD: ${DATABASE_PASSWORD} #WEB_APP_HOST: ${WEB_APP_HOST:-0.0.0.0} #WEB_APP_PORT: ${WEB_APP_PORT:-80} RUST_LOG: smart_fridge=debug,api_web=debug,fridge_supervisor=debug # careful: '-' become '_' server_supervisor: #image: docker.io/valentincolin/smart-fridge-server_supervisor:2.0.0 image: smart-fridge-server_supervisor-test:2.0.0 build: context: . dockerfile: Dockerfile.supervisor target: runner depends_on: db: condition: service_healthy # Pour l'initialisation de la bdd server: condition: service_started environment: <<: *env_server db: image: postgres:15 restart: unless-stopped user: postgres # secrets: # - db-password volumes: - db-data:/var/lib/postgresql/data environment: #POSTGRES_DB: ${DATABASE_NAME:-postgres} #POSTGRES_USER: ${DATABASE_USERNAME:-postgres} POSTGRES_PASSWORD: ${DATABASE_PASSWORD} expose: - 5432 healthcheck: test: [ "CMD", "pg_isready" ] interval: 10s timeout: 5s retries: 5 volumes: db-data: # The best way to manage credentials, but for the purposes of this exercise, # we will only use variable env. #secrets: # db-password: # file: secrets/password.txt