docker-compose.prod.yml 2.32 KB
Newer Older
Jacob Priddy's avatar
Jacob Priddy committed
1
version: '3.8'
Jacob Priddy's avatar
Jacob Priddy committed
2 3 4 5 6 7 8

networks:
  doorcode:
    driver: bridge

secrets:
  webserver_cert:
Jacob Priddy's avatar
Jacob Priddy committed
9
    file: $WEBSERVER_CERT
Jacob Priddy's avatar
Jacob Priddy committed
10
  webserver_key:
Jacob Priddy's avatar
Jacob Priddy committed
11
    file: $WEBSERVER_KEY
Jacob Priddy's avatar
Jacob Priddy committed
12
  root_cert:
Jacob Priddy's avatar
Jacob Priddy committed
13
    file: $ROOT_CERT
14
  wwu_webserver_cert:
Jacob Priddy's avatar
Jacob Priddy committed
15
    file: $WWU_WEBSERVER_CERT
16
  wwu_webserver_key:
Jacob Priddy's avatar
Jacob Priddy committed
17
    file: $WWU_WEBSERVER_KEY
18
  wwu_root_cert:
Jacob Priddy's avatar
Jacob Priddy committed
19
    file: $WWU_ROOT_CERT
Jacob Priddy's avatar
Jacob Priddy committed
20
  postgres_password:
Jacob Priddy's avatar
Jacob Priddy committed
21
    file: $POSTGRES_PASSWORD
Jacob Priddy's avatar
Jacob Priddy committed
22 23 24

volumes:
  db-data:
Jacob Priddy's avatar
Jacob Priddy committed
25
  pgadmin-data:
Jacob Priddy's avatar
Jacob Priddy committed
26 27 28

services:
  webserver:
Jacob Priddy's avatar
Jacob Priddy committed
29
    image: $NGINX_IMAGE_NAME
Jacob Priddy's avatar
Jacob Priddy committed
30 31 32 33 34
    restart: always
    secrets:
      - webserver_cert
      - webserver_key
      - root_cert
35 36 37
      - wwu_webserver_cert
      - wwu_webserver_key
      - wwu_root_cert
Jacob Priddy's avatar
Jacob Priddy committed
38
    ports:
39
      - "4433:4433"
Jacob Priddy's avatar
Jacob Priddy committed
40
      - "443:443"
41
      - "80:80"
Jacob Priddy's avatar
Jacob Priddy committed
42
    volumes:
Jacob Priddy's avatar
Jacob Priddy committed
43 44 45
      - $PROJ_DIR/simple-saml/cert:/var/simplesamlphp/cert:ro
      - $PROJ_DIR/simple-saml/config:/var/simplesamlphp/config:ro
      - $PROJ_DIR/simple-saml/metadata:/var/simplesamlphp/metadata
46 47
    depends_on:
      - dbadmin
Jacob Priddy's avatar
Jacob Priddy committed
48
      - api
49 50 51 52
    logging:
      options:
        max-size: "10m"
        max-file: "3"
Jacob Priddy's avatar
Jacob Priddy committed
53 54 55
    networks:
      - doorcode
  postgres:
56
    image: postgres:13-alpine
Jacob Priddy's avatar
Jacob Priddy committed
57
    restart: always
58 59
    secrets:
      - postgres_password
Jacob Priddy's avatar
Jacob Priddy committed
60
    ports:
61
      - "127.0.0.1:5432:5432"
Jacob Priddy's avatar
Jacob Priddy committed
62 63 64 65 66 67
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: web
      POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
      POSTGRES_DB: doorcode
68 69 70 71
    logging:
      options:
        max-size: "10m"
        max-file: "3"
Jacob Priddy's avatar
Jacob Priddy committed
72 73 74
    networks:
      - doorcode
  dbadmin:
Jacob Priddy's avatar
Jacob Priddy committed
75
    image: dpage/pgadmin4:4.24
Jacob Priddy's avatar
Jacob Priddy committed
76 77 78
    restart: always
    depends_on:
      - postgres
Jacob Priddy's avatar
Jacob Priddy committed
79 80
    volumes:
      - pgadmin-data:/var/lib/pgadmin
Jacob Priddy's avatar
Jacob Priddy committed
81
    environment:
Jacob Priddy's avatar
Jacob Priddy committed
82 83
      PGADMIN_DEFAULT_EMAIL: admin@elock
      PGADMIN_DEFAULT_PASSWORD: Please change the default password.
84 85 86 87
    logging:
      options:
        max-size: "10m"
        max-file: "3"
Jacob Priddy's avatar
Jacob Priddy committed
88 89 90
    networks:
      - doorcode
  api:
Jacob Priddy's avatar
Jacob Priddy committed
91
    image: $DOORCODE_IMAGE_NAME
Jacob Priddy's avatar
Jacob Priddy committed
92 93
    restart: always
    volumes:
Jacob Priddy's avatar
Jacob Priddy committed
94 95 96 97 98
      - $PROJ_DIR/.env:/var/www/backend/.env:ro
      - $PROJ_DIR/controller-bins:/var/www/backend/storage/app/controller/binaries:ro
      - $PROJ_DIR/simple-saml/cert:/var/simplesamlphp/cert:ro
      - $PROJ_DIR/simple-saml/config:/var/simplesamlphp/config:ro
      - $PROJ_DIR/simple-saml/metadata:/var/simplesamlphp/metadata
99 100 101 102
    logging:
      options:
        max-size: "10m"
        max-file: "3"
Jacob Priddy's avatar
Jacob Priddy committed
103 104
    networks:
      - doorcode