-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (46 loc) · 984 Bytes
/
docker-compose.yml
File metadata and controls
46 lines (46 loc) · 984 Bytes
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
version: '3.8'
services:
api:
build:
context: .
dockerfile: Dockerfile
target: development
ports:
- "8080:8080"
depends_on:
- db
environment:
DB_HOST: db
DB_USER: urlshortener
DB_PASSWORD: password
DB_NAME: urlshortener
DB_PORT: 5432
DATABASE_URL: localhost
develop:
watch:
- action: rebuild
path: .
target: development
volumes:
- .:/app
- go-modules:/go/pkg/mod
db:
image: postgres:14
environment:
POSTGRES_USER: urlshortener
POSTGRES_PASSWORD: password
POSTGRES_DB: urlshortener
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
sqlc:
image: sqlc/sqlc
volumes:
- .:/src
working_dir: /src
# This ensures the service exits after generating code
command: generate
volumes:
go-modules:
postgres-data: