-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.couchdb.yml
More file actions
63 lines (59 loc) · 1.78 KB
/
docker-compose.couchdb.yml
File metadata and controls
63 lines (59 loc) · 1.78 KB
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
# Define common environment variables (explicit configuration required)
x-couchdb-variables: &couchdb-variables
COUCHDB_USERNAME: ${COUCHDB_USERNAME:?COUCHDB_USERNAME is required. Please set it in .env file or environment}
COUCHDB_PASSWORD: ${COUCHDB_PASSWORD:?COUCHDB_PASSWORD is required. Please set it in .env file or environment}
COUCHDB_DATABASE: ${COUCHDB_DATABASE:?COUCHDB_DATABASE is required. Please set it in .env file or environment}
services:
couchdb:
build:
context: .
dockerfile: couchdb.Dockerfile
container_name: notes-couchdb
environment:
<<: *couchdb-variables
COUCHDB_USER: ${COUCHDB_USERNAME}
COUCHDB_PASSWORD: ${COUCHDB_PASSWORD}
ports:
- "5984:5984"
volumes:
- couchdb_data:/opt/couchdb/data
networks:
- notes-network
healthcheck:
test: [ "CMD", "curl", "-f", "http://${COUCHDB_USERNAME}:${COUCHDB_PASSWORD}@localhost:5984/_up" ]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
notes-app:
build:
context: .
dockerfile: notes.Dockerfile
container_name: notes-app-couchdb
environment:
<<: *couchdb-variables
NODE_ENV: production
HOST: 0.0.0.0
PORT: 3000
DB_VENDOR: couchdb
COUCHDB_URL: http://${COUCHDB_USERNAME}:${COUCHDB_PASSWORD}@couchdb:5984
COUCHDB_DB_NAME: ${COUCHDB_DATABASE}
ports:
- "3000:3000"
depends_on:
couchdb:
condition: service_healthy
networks:
- notes-network
healthcheck:
test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
couchdb_data:
driver: local
networks:
notes-network:
driver: bridge