forked from privacybydesign/irmago
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
99 lines (94 loc) · 2.75 KB
/
docker-compose.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
version: '3.1'
services:
# Dependencies for running unit tests and for running the 'irma' command line tool using one of the test configurations.
postgres:
image: postgres:13
environment:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpassword
POSTGRES_DB: test
networks:
# We use a localhost alias such that the test configuration also works for users who run it without Docker.
irma-net:
aliases:
- postgres.localhost
ports:
- 5432:5432
postgres-init:
image: postgres:13
environment:
PGHOST: postgres
PGUSER: testuser
PGPASSWORD: testpassword
PGDATABASE: test
networks:
- irma-net
depends_on:
- postgres
volumes:
- ./server/keyshare/schema.sql:/schema.sql
- ./server/keyshare/cleanup.sql:/cleanup.sql
# We have to wait until the database is up and running.
# Database might already be running, so we need to do a cleanup first.
command: /bin/sh -c "sleep 5 && psql -f cleanup.sql && psql -f schema.sql"
mailhog:
image: mailhog/mailhog
networks:
# We use a localhost alias such that the test configuration also works for users who run it without Docker.
irma-net:
aliases:
- mailhog.localhost
ports:
- 1025:1025
- 8025:8025 # Port of the web interface
# Frontend of 'irma keyshare myirmaserver'
webclient:
image: privacybydesign/irma_keyshare_webclient
build:
context: https://github.com/privacybydesign/irma_keyshare_webclient.git
profiles:
- webclient
networks:
irma-net:
aliases:
- webclient.localhost
ports:
- 3000:3000
# Service to run unit tests
test:
image: golang:1
# Add a test profile to prevent this service to be included when running docker-compose up.
profiles:
- test
volumes:
- .:/irmago
depends_on:
- postgres
- mailhog
# The tests assume postgres and mailhog can be accessed on localhost. Therefore, we use host networking.
network_mode: host
working_dir: /irmago
entrypoint: go test -p 1
command: ./...
# Service to run the 'irma' command line tool
irma:
build: .
image: privacybydesign/irma:edge
# Add a run profile to prevent this service to be included when running docker-compose up.
profiles:
- run
volumes:
- .:/irmago
working_dir: /irmago
depends_on:
- postgres
- postgres-init
- mailhog
networks:
- irma-net
# Docker Desktop for MacOS does not support exposing ports when using host networking. Therefore,
# we have to use bridge networking and expose the ports manually.
# https://github.com/docker/for-mac/issues/1031
networks:
irma-net:
driver: bridge