version: "3.8" services: postgres: image: postgres:16.8-alpine environment: POSTGRES_DB: messenger POSTGRES_USER: messenger POSTGRES_PASSWORD_FILE: /run/secrets/lab3_db_password secrets: [lab3_db_password] volumes: - postgres_data:/var/lib/postgresql/data networks: [data] deploy: replicas: 1 placement: constraints: [node.labels.lab3_storage == true] resources: limits: cpus: "1.0" memory: 512M redis: image: redis:7.4.2-alpine command: ["redis-server", "--save", "", "--appendonly", "no", "--maxmemory", "128mb", "--maxmemory-policy", "allkeys-lru"] networks: [data] deploy: replicas: 1 placement: constraints: [node.labels.lab3_storage == true] resources: limits: cpus: "0.5" memory: 192M networks: data: driver: overlay attachable: true volumes: postgres_data: secrets: lab3_db_password: external: true