docker-compose.prod.yml 2.36 KB
Newer Older
Jacob Priddy's avatar
Jacob Priddy committed
1
version: '3.8'
Jacob Priddy's avatar
Jacob Priddy committed
2 3 4

networks:
  doorcode:
Jacob Priddy's avatar
Jacob Priddy committed
5
    attachable: true
Jacob Priddy's avatar
Jacob Priddy committed
6 7 8

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
    secrets:
      - webserver_cert
      - webserver_key
      - root_cert
34 35 36
      - wwu_webserver_cert
      - wwu_webserver_key
      - wwu_root_cert
Jacob Priddy's avatar
Jacob Priddy committed
37
    ports:
Jacob Priddy's avatar
Jacob Priddy committed
38 39 40 41 42 43 44 45 46
      - target: "4433"
        published: "4433"
        mode: host
      - target: "443"
        published: "443"
        mode: host
      - target: "80"
        published: "80"
        mode: host
Jacob Priddy's avatar
Jacob Priddy committed
47
    volumes:
Jacob Priddy's avatar
Jacob Priddy committed
48 49 50
      - $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
51 52 53 54
    logging:
      options:
        max-size: "10m"
        max-file: "3"
Jacob Priddy's avatar
Jacob Priddy committed
55 56 57
    networks:
      - doorcode
  postgres:
58
    image: postgres:13-alpine
59 60
    secrets:
      - postgres_password
Jacob Priddy's avatar
Jacob Priddy committed
61
    ports:
Jacob Priddy's avatar
Jacob Priddy committed
62 63 64
      - target: "5432"
        published: "127.0.0.1:5432"
        mode: host
Jacob Priddy's avatar
Jacob Priddy committed
65 66 67 68 69 70
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: web
      POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
      POSTGRES_DB: doorcode
71 72 73 74
    logging:
      options:
        max-size: "10m"
        max-file: "3"
Jacob Priddy's avatar
Jacob Priddy committed
75 76 77
    networks:
      - doorcode
  dbadmin:
Jacob Priddy's avatar
Jacob Priddy committed
78
    image: dpage/pgadmin4:4.24
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
    volumes:
Jacob Priddy's avatar
Jacob Priddy committed
93 94 95 96 97
      - $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
98 99 100 101
    logging:
      options:
        max-size: "10m"
        max-file: "3"
Jacob Priddy's avatar
Jacob Priddy committed
102 103
    networks:
      - doorcode