Commit 9fe2d280 authored by melody's avatar melody Committed by derf
Browse files

fix(docker-compose): fix and style improvements

parent a307f6d9
Loading
Loading
Loading
Loading
+24 −35
Original line number Diff line number Diff line
@@ -2,43 +2,32 @@
#
# SPDX-License-Identifier: CC0-1.0

version: "3.6"
x-common-env: &common-env
  TRAVELYNX_DB_HOST: database
  TRAVELYNX_DB_NAME: travelynx
  TRAVELYNX_DB_USERNAME: travelynx
  TRAVELYNX_DB_PASSWORD: travelynx
  TRAVELYNX_SECRET: 12345678
  TRAVELYNX_MAIL_DISABLE: 1
  MOJO_MODE: development

x-common-config: &common-config
  volumes:
    - ./examples/docker/travelynx.conf:/app/travelynx.conf
  build: .
  networks:
    - backend
  
services:
  database:
    image: postgres:11
    networks:
      - backend
    environment: 
      <<: *common-env
    volumes:
      - ./examples/docker/postgres-init.sh:/docker-entrypoint-initdb.d/init.sh
  travelynx:
    <<: *common-config
    build: .
    volumes:
      - ./travelynx.conf:/app/travelynx.conf
      - ./travelynx-conf:/app/local
    ports:
      - "8000:8093"
    environment:
      <<: *common-env
      - 127.0.0.1:8000:8093
    links:
      - db
    restart: unless-stopped

  cron:
    <<: *common-config
    environment:
      <<: *common-env
      CRON: 1
    build: .
    volumes:
      - ./travelynx.conf:/app/travelynx.conf
      - ./travelynx-conf:/app/local
    command: worker
    links:
      - db
    restart: unless-stopped

  db:
    image: postgres:17
    env_file: db.env
    volumes:
      - ./db-data:/var/lib/postgresql/data
    restart: unless-stopped
networks:
  backend: