summaryrefslogtreecommitdiff
path: root/docker-compose.yml
blob: bcc96beff07c80f703ff23224ceb289791b15909 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
services:
  web:
    image: nginx:alpine
    restart: unless-stopped
    ports:
     - '80:80'
    volumes:
      - ./src:/opt/xssbook:ro
      - ./conf/nginx:/etc/nginx/conf.d:ro
    depends_on:
      - rest
      - swagger
      - php

  php:
    build: ./build/php
    restart: unless-stopped
    env_file:
      - ./conf/postgres/database.env
    volumes:
      - ./src:/opt/xssbook:ro
      - ./data/status:/status:ro
      - ./data/session:/var/lib/php/session
    depends_on:
      - db

  db:
    #image: postgres:16-alpine
    build: ./build/postgres
    restart: unless-stopped
    env_file:
      - ./conf/postgres/database.env
    environment:
      - POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
    volumes:
      - './data/schemas:/var/lib/postgresql/data'
      - ./src/db:/db:ro

  rest:
    build: ./build/postgrest
    env_file:
      - ./conf/postgres/database.env
    depends_on:
      - db

  init:
    build: ./build/dbinit
    env_file:
      - ./conf/postgres/database.env
    volumes:
      - ./src/db:/db:ro
      - ./data/status:/status
    depends_on:
      - db

  swagger:
    image: swaggerapi/swagger-ui
    environment:
      SWAGGER_JSON_URL: '/api'
      BASE_URL: '/apidocs'
      PORT: 3000
    depends_on:
      - db