summaryrefslogtreecommitdiff
path: root/docker-compose.yml
blob: 345e531c38e8337dd8793827aa034be2106dc12e (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
64
65
66
67
68
69
## Example Docker Compose configuration
##
## Use this as a template to set up docker-compose, or as guide to set up other
## orchestration services
version: '2'

services:
  api:
    build:
      context: ./server
    depends_on:
      - sql
      - elasticsearch
    environment:
      ## These should be the names of the dependent containers listed above,
      ## or FQDNs/IP addresses if these services are running outside of Docker
      POSTGRES_HOST: sql
      ESEARCH_HOST: elasticsearch
      ## Credentials for database:
      POSTGRES_USER:
      POSTGRES_PASSWORD:
      ## Commented Values are Default:
      #POSTGRES_DB: defaults to same as POSTGRES_USER
      #POSTGRES_PORT: 5432
      #ESEARCH_PORT: 9200
      #ESEARCH_INDEX: szurubooru
      #LOG_SQL: 0 (1 for verbose SQL logs)
    volumes:
      - "${MOUNT_DATA}:/data"
      - "./server/config.yaml:/opt/app/config.yaml"
  client:
    build:
      context: ./client
      args:
        BUILD_INFO:
    depends_on:
      - api
    environment:
      BACKEND_HOST: api
      BASE_URL:
    volumes:
      - "${MOUNT_DATA}:/data:ro"
    ports:
      - "${PORT}:80"
  sql:
    image: postgres:11-alpine
    restart: unless-stopped
    environment:
      POSTGRES_USER:
      POSTGRES_PASSWORD:
    volumes:
      - "${MOUNT_SQL}:/var/lib/postgresql/data"
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.3.1
    environment:
      ## Specifies the Java heap size used
      ## Read
      ##  https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html
      ## for more info
      ES_JAVA_OPTS: -Xms512m -Xmx512m
    volumes:
      - index:/usr/share/elasticsearch/data
    ulimits:
      nofile:
        soft: 65536
        hard: 65536

volumes:
  index: # Scratch space for ElasticSearch index, will be rebuilt if lost