docker-compose.yml.example 2.53 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
17

volumes:
  db-data:

18
19
services:
  webserver:
20
    image: nginx:1-alpine
21
22
23
    container_name: webserver
    restart: unless-stopped
    tty: true
Jacob Priddy's avatar
Jacob Priddy committed
24
25
26
    secrets:
      - webserver_cert
      - webserver_key
27
      - root_cert
28
    ports:
Jacob Priddy's avatar
Jacob Priddy committed
29
      - "8080:443"
30
    volumes:
31
      - ./src:/var/www
32
33
      - ./nginx/conf.d/:/etc/nginx/conf.d
      - ./nginx/dhparam/:/run/dhparam
Jacob Priddy's avatar
Jacob Priddy committed
34
      # Saml config
Jacob Priddy's avatar
Jacob Priddy committed
35
      - ./simplesamlphp-1.18.5:/var/simplesamlphp
Jacob Priddy's avatar
Jacob Priddy committed
36
37
38
      - ./simple-saml/cert:/var/simplesamlphp/cert
      - ./simple-saml/config:/var/simplesamlphp/config
      - ./simple-saml/metadata:/var/simplesamlphp/metadata
Jacob Priddy's avatar
Jacob Priddy committed
39
      - ./simplesamlphp-1.18.5:/var/simplesamlphp-idp
Jacob Priddy's avatar
Jacob Priddy committed
40
41
42
      - ./simple-saml-idp/cert:/var/simplesamlphp-idp/cert
      - ./simple-saml-idp/config:/var/simplesamlphp-idp/config
      - ./simple-saml-idp/metadata:/var/simplesamlphp-idp/metadata
43
44
    networks:
      - doorcode
45
  postgres:
46
    image: postgres:11-alpine
47
    container_name: postgres
48
49
50
    restart: unless-stopped
    tty: true
    ports:
51
      - "5432:5432"
Jacob Priddy's avatar
Jacob Priddy committed
52
53
    volumes:
      - db-data:/var/lib/postgresql/data
54
    environment:
55
56
57
      POSTGRES_USER: web
      POSTGRES_PASSWORD: secret
      POSTGRES_DB: doorcode
58
59
    networks:
      - doorcode
60
61
62
63
64
65
66
  dbadmin:
    image: dockage/phppgadmin:latest
    container_name: dbadmin
    restart: unless-stopped
    tty: true
    ports:
      - "8081:80"
Jacob Priddy's avatar
Jacob Priddy committed
67
68
    depends_on:
      - postgres
69
    environment:
70
      PHP_PG_ADMIN_SERVER_HOST: postgres
71
      PHP_PG_ADMIN_SERVER_DEFAULT_DB: doorcode
72
      PHP_PG_ADMIN_SERVER_PORT: 5432
73
74
    networks:
      - doorcode
75
76
77
  api:
    build:
      context: .
Jacob Priddy's avatar
Jacob Priddy committed
78
      dockerfile: dev.Dockerfile
79
80
    container_name: api
    volumes:
81
      - ./src:/var/www
82
      - ./php/dev.ini:/usr/local/etc/php/conf.d/local.ini
Jacob Priddy's avatar
Jacob Priddy committed
83
      # Map saml files to the php-fpm server so it has access to them as well
Jacob Priddy's avatar
Jacob Priddy committed
84
      - ./simplesamlphp-1.18.5:/var/simplesamlphp
Jacob Priddy's avatar
Jacob Priddy committed
85
86
87
      - ./simple-saml/cert:/var/simplesamlphp/cert
      - ./simple-saml/config:/var/simplesamlphp/config
      - ./simple-saml/metadata:/var/simplesamlphp/metadata
Jacob Priddy's avatar
Jacob Priddy committed
88
      - ./simplesamlphp-1.18.5:/var/simplesamlphp-idp
Jacob Priddy's avatar
Jacob Priddy committed
89
90
91
      - ./simple-saml-idp/cert:/var/simplesamlphp-idp/cert
      - ./simple-saml-idp/config:/var/simplesamlphp-idp/config
      - ./simple-saml-idp/metadata:/var/simplesamlphp-idp/metadata
92
93
    ports:
      - "9000:9000"
Jacob Priddy's avatar
Jacob Priddy committed
94
      - "8000:8000"
95
96
    networks:
      - doorcode