docker-compose.example.yml 2.89 KB
Newer Older
Jacob Priddy's avatar
Jacob Priddy committed
1
version: '3.7'
2 3 4 5 6

networks:
  doorcode:
    driver: bridge

Jacob Priddy's avatar
Jacob Priddy committed
7 8 9 10 11
secrets:
  webserver_cert:
    file: ./secrets/certs/webserver.cert
  webserver_key:
    file: ./secrets/certs/webserver.key
12 13
  root_cert:
    file: ./secrets/certs/root.cert
Jacob Priddy's avatar
Jacob Priddy committed
14 15 16

volumes:
  db-data:
Jacob Priddy's avatar
Jacob Priddy committed
17
  pgadmin-data:
Jacob Priddy's avatar
Jacob Priddy committed
18

19 20
services:
  webserver:
21
    image: nginx:1-alpine
22 23 24
    container_name: webserver
    restart: unless-stopped
    tty: true
Jacob Priddy's avatar
Jacob Priddy committed
25 26 27
    secrets:
      - webserver_cert
      - webserver_key
28
      - root_cert
29
    ports:
Jacob Priddy's avatar
Jacob Priddy committed
30
      - "8080:443"
31
    volumes:
32
      - ./src:/var/www
33
      - ./nginx/conf.d/app.conf:/etc/nginx/conf.d/app.conf
34
      - ./nginx/dhparam/:/run/dhparam
Jacob Priddy's avatar
Jacob Priddy committed
35
      # Saml config
36
      - ./simplesamlphp-1.19.0-rc1:/var/simplesamlphp
Jacob Priddy's avatar
Jacob Priddy committed
37 38 39
      - ./simple-saml/cert:/var/simplesamlphp/cert
      - ./simple-saml/config:/var/simplesamlphp/config
      - ./simple-saml/metadata:/var/simplesamlphp/metadata
40
      - ./simplesamlphp-1.19.0-rc1:/var/simplesamlphp-idp
Jacob Priddy's avatar
Jacob Priddy committed
41 42 43
      - ./simple-saml-idp/cert:/var/simplesamlphp-idp/cert
      - ./simple-saml-idp/config:/var/simplesamlphp-idp/config
      - ./simple-saml-idp/metadata:/var/simplesamlphp-idp/metadata
44 45
    depends_on:
      - dbadmin
Jacob Priddy's avatar
Jacob Priddy committed
46
      - api
47 48 49 50
    logging:
      options:
        max-size: "10m"
        max-file: "3"
51 52
    networks:
      - doorcode
53
  postgres:
Jacob Priddy's avatar
Jacob Priddy committed
54
    image: postgres:13-alpine
55
    container_name: postgres
56 57 58
    restart: unless-stopped
    tty: true
    ports:
59
      - "5432:5432"
Jacob Priddy's avatar
Jacob Priddy committed
60 61
    volumes:
      - db-data:/var/lib/postgresql/data
62
    environment:
63 64 65
      POSTGRES_USER: web
      POSTGRES_PASSWORD: secret
      POSTGRES_DB: doorcode
66 67 68 69
    logging:
      options:
        max-size: "10m"
        max-file: "3"
70 71
    networks:
      - doorcode
72
  dbadmin:
Jacob Priddy's avatar
Jacob Priddy committed
73
    image: dpage/pgadmin4:latest
74 75 76 77 78
    container_name: dbadmin
    restart: unless-stopped
    tty: true
    ports:
      - "8081:80"
Jacob Priddy's avatar
Jacob Priddy committed
79 80
    depends_on:
      - postgres
Jacob Priddy's avatar
Jacob Priddy committed
81 82
    volumes:
      - pgadmin-data:/var/lib/pgadmin
83
    environment:
Jacob Priddy's avatar
Jacob Priddy committed
84 85
      PGADMIN_DEFAULT_EMAIL: admin@elock
      PGADMIN_DEFAULT_PASSWORD: secret
86 87 88 89
    logging:
      options:
        max-size: "10m"
        max-file: "3"
90 91
    networks:
      - doorcode
92 93 94 95 96 97
  api:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: api
    volumes:
98
      - ./src:/var/www
99
      - ./php/dev.ini:/usr/local/etc/php/conf.d/local.ini
Jacob Priddy's avatar
Jacob Priddy committed
100
      # Map saml files to the php-fpm server so it has access to them as well
101
      - ./simplesamlphp-1.19.0-rc1:/var/simplesamlphp
Jacob Priddy's avatar
Jacob Priddy committed
102 103 104
      - ./simple-saml/cert:/var/simplesamlphp/cert
      - ./simple-saml/config:/var/simplesamlphp/config
      - ./simple-saml/metadata:/var/simplesamlphp/metadata
105
      - ./simplesamlphp-1.19.0-rc1:/var/simplesamlphp-idp
Jacob Priddy's avatar
Jacob Priddy committed
106 107 108
      - ./simple-saml-idp/cert:/var/simplesamlphp-idp/cert
      - ./simple-saml-idp/config:/var/simplesamlphp-idp/config
      - ./simple-saml-idp/metadata:/var/simplesamlphp-idp/metadata
109
    ports:
Jacob Priddy's avatar
Jacob Priddy committed
110
      - "8000:8000"
111 112 113 114
    logging:
      options:
        max-size: "10m"
        max-file: "3"
115 116
    networks:
      - doorcode