Docker Compose not reading multiple files

Viewed 24

Using the below docker compose files, i am unable to bring up my app correctly. Docker says my LAPIS_ENV environment variable is not set, but i am setting it in my second compose file which I am expecting to be merged into the first one. I have tried including them in reverse order to no avail.

version: '2.4'

services:
  backend:
    mem_limit: 50mb
    memswap_limit: 50mb
    build:
      context: ./backend
      dockerfile: Dockerfile
    depends_on:
      - postgres
    volumes:
      - ./backend:/var/www
      - ./data:/var/data
    restart: unless-stopped
    command: bash -c "/usr/local/bin/docker-entrypoint.sh ${LAPIS_ENV}"

  postgres:
    build:
      context: ./postgres
      dockerfile: Dockerfile
    environment:
      PGDATA: /var/lib/postgresql/data/pgdata
      POSTGRES_HOST_AUTH_METHOD: trust
    volumes:
      - postgres:/var/lib/postgresql/data
      - ./postgres/pg_hba.conf:/var/lib/postgres/data/pg_hba.conf
      - ./data/backup:/pgbackup
    restart: unless-stopped

volumes:
  postgres:
version: '2.4'

services:
  backend:
    environment:
      LAPIS_ENV: development
    ports:
      - 8080:80
#!/usr/bin/env bash
docker compose -f docker-compose.yml -f docker-compose.dev.yml up
0 Answers
Related