-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
docker-compose.yml
88 lines (82 loc) · 2.37 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
services:
web:
build: .
# Sorbet doesn't currently build for Linux ARM64 (see https://github.com/sorbet/sorbet/issues/4119)
# So, we're forced to build the container as linux/amd64 always and lean on Rosetta
# on Apple silicon for running this.
# Important: if you're on Apple Silicon ensure that "Use Rosetta for x86/amd64 emulation on Apple Silicon"
# is switched on in Docker Desktop.
platform: linux/amd64
volumes:
- .:/app
- gem_cache:/usr/local/bundle/gems
ports:
- "3000:3000"
depends_on:
- postgres
- redis
- mailcatcher
- elasticsearch
command: "bin/dev"
tty: true
postfix:
build: .
# Same as "web" service above because of sorbet we need to build as amd64
platform: linux/amd64
volumes:
- .:/app
- gem_cache:/usr/local/bundle/gems
ports:
- "2525:25"
depends_on:
- postgres
user: root
command: postfix start-fg
postgres:
# Same version as used in production
image: postgis/postgis:15-3.3
# There isn't yet a linux/arm64 build of postgis on docker
# See https://github.com/postgis/docker-postgis/issues/216
platform: linux/amd64
ports:
# Give access to the database from your host machine. This is useful
# if you want to poke around.
# Note that we're forwarding this to port 15432 on the host machine so
# that it doesn't conflict with any postgres server you might have running there.
- 15432:5432
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
# The values below need to be the same in config/database.yml
POSTGRES_PASSWORD: password
redis:
# TODO: Try switching to alpine variant for slimmer images
# We're also using redis 6.2 in production
image: redis:6.2
ports:
- "6379"
volumes:
- redis_data:/data
mailcatcher:
build:
context: .
dockerfile: Dockerfile.mailcatcher
ports:
- "1080:1080"
elasticsearch:
# Using version 7.17.7 in production. So matching here
# TODO: Upgrade when we can
image: elasticsearch:7.17.7
ports:
- "9200"
mem_limit: 1073741824
environment:
- "discovery.type=single-node"
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
volumes:
gem_cache:
database_data:
postgres_data:
redis_data:
elasticsearch_data: