docker-compose.yml.example 2.56 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.18.7:/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.18.7:/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
    networks:
      - doorcode
46
  postgres:
Jacob Priddy's avatar
Jacob Priddy committed
47
    image: postgres:13-alpine
48
    container_name: postgres
49
50
51
    restart: unless-stopped
    tty: true
    ports:
52
      - "5432:5432"
Jacob Priddy's avatar
Jacob Priddy committed
53
54
    volumes:
      - db-data:/var/lib/postgresql/data
55
    environment:
56
57
58
      POSTGRES_USER: web
      POSTGRES_PASSWORD: secret
      POSTGRES_DB: doorcode
59
60
    networks:
      - doorcode
61
  dbadmin:
Jacob Priddy's avatar
Jacob Priddy committed
62
    image: dpage/pgadmin4:latest
63
64
65
66
67
    container_name: dbadmin
    restart: unless-stopped
    tty: true
    ports:
      - "8081:80"
Jacob Priddy's avatar
Jacob Priddy committed
68
69
    depends_on:
      - postgres
Jacob Priddy's avatar
Jacob Priddy committed
70
71
    volumes:
      - pgadmin-data:/var/lib/pgadmin
72
    environment:
Jacob Priddy's avatar
Jacob Priddy committed
73
74
      PGADMIN_DEFAULT_EMAIL: admin@elock
      PGADMIN_DEFAULT_PASSWORD: secret
75
76
    networks:
      - doorcode
77
78
79
80
81
82
  api:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: api
    volumes:
83
      - ./src:/var/www
84
      - ./php/dev.ini:/usr/local/etc/php/conf.d/local.ini
Jacob Priddy's avatar
Jacob Priddy committed
85
      # Map saml files to the php-fpm server so it has access to them as well
86
      - ./simplesamlphp-1.18.7:/var/simplesamlphp
Jacob Priddy's avatar
Jacob Priddy committed
87
88
89
      - ./simple-saml/cert:/var/simplesamlphp/cert
      - ./simple-saml/config:/var/simplesamlphp/config
      - ./simple-saml/metadata:/var/simplesamlphp/metadata
90
      - ./simplesamlphp-1.18.7:/var/simplesamlphp-idp
Jacob Priddy's avatar
Jacob Priddy committed
91
92
93
      - ./simple-saml-idp/cert:/var/simplesamlphp-idp/cert
      - ./simple-saml-idp/config:/var/simplesamlphp-idp/config
      - ./simple-saml-idp/metadata:/var/simplesamlphp-idp/metadata
94
95
    ports:
      - "9000:9000"
Jacob Priddy's avatar
Jacob Priddy committed
96
      - "8000:8000"
97
98
    networks:
      - doorcode