-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
docker-compose.yaml
43 lines (39 loc) · 892 Bytes
/
docker-compose.yaml
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
# ./docker-compose.yaml
version: '3.2'
services:
urlsh:
image: golang:1.16-alpine3.12
working_dir: /go/src/app
command: sh -c 'sleep 2 && go run main.go'
ports:
- ${PORT:-2000}:${PORT:-2000}
volumes:
- .:/go/src/app:delegated
env_file:
- .env
environment:
- POSTGRES_HOST=urlshdb
- CGO_ENABLED=0
depends_on:
- urlshdb
- urlshcache
urlshdb:
image: postgres:12.4-alpine
ports:
- 2001:5432
volumes:
- dbdata:/var/lib/postgresql
- ./init-test-db.sh:/docker-entrypoint-initdb.d/init-test-db.sh
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- POSTGRES_DB=urlsh
urlshcache:
image: redis:alpine
ports:
- 2002:6379
volumes:
- cachedata:/data
volumes:
dbdata: {}
cachedata: {}