docker-compose.yml.example 2.44 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
12
13
14
15
secrets:
  webserver_cert:
    file: ./secrets/certs/webserver.cert
  webserver_key:
    file: ./secrets/certs/webserver.key

volumes:
  db-data:

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