-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.yml
83 lines (79 loc) · 2.49 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
version: "3.7"
services:
#Fupisha API server container
fupisha:
build:
context: .
target: prod
container_name: api
depends_on:
- postgresql
- redis
ports:
- ${FUPISHA_HTTP_PORT}:${FUPISHA_HTTP_PORT}
command:
["./main", "start",]
volumes:
- ./fupisha:/fupisha
tty: true
environment: #loaded from .env file
# Golang CGO
- CGO_ENABLED=0
# smtp config
- FUPISHA_SMTP_PORT=${FUPISHA_SMTP_PORT}
- FUPISHA_SMTP_HOST=${FUPISHA_SMTP_HOST}
- FUPISHA_SMTP_USERNAME=${FUPISHA_SMTP_USERNAME}
- FUPISHA_SMTP_PASSWORD=${FUPISHA_SMTP_PASSWORD}
- FUPISHA_SMTP_FROM_NAME=${FUPISHA_SMTP_FROM_NAME}
- FUPISHA_SMTP_FROM_ADDRESS=${FUPISHA_SMTP_FROM_ADDRESS}
# store type
- FUPISHA_STORE_TYPE=${FUPISHA_STORE_TYPE}
# database config
- FUPISHA_STORE_POSTGRESQL_ADDRESS=${FUPISHA_STORE_POSTGRESQL_ADDRESS}
- FUPISHA_STORE_POSTGRESQL_USERNAME=${FUPISHA_STORE_POSTGRESQL_USERNAME}
- FUPISHA_STORE_POSTGRESQL_PASSWORD=${FUPISHA_STORE_POSTGRESQL_PASSWORD}
- FUPISHA_STORE_POSTGRESQL_DATABASE=${FUPISHA_STORE_POSTGRESQL_DATABASE}
# auth config
- FUPISHA_JWT_SECRET=${FUPISHA_JWT_SECRET}
- FUPISHA_JWT_EXPIRE_DELTA=${FUPISHA_JWT_EXPIRE_DELTA}
# app config
- FUPISHA_BASE_URL=${FUPISHA_BASE_URL}
- FUPISHA_TITLE=${FUPISHA_TITLE}
- FUPISHA_LOG_LEVEL=${FUPISHA_LOG_LEVEL}
- FUPISHA_TEXT_LOGGING=${FUPISHA_TEXT_LOGGING}
- FUPISHA_PARAM_LENGTH=${FUPISHA_PARAM_LENGTH}
- FUPISHA_HTTP_PORT=${FUPISHA_HTTP_PORT}
networks:
- fupisha-api
# Redis (Cache) Container
redis:
image: redis:5.0.7
container_name: cache
ports:
- 6379:6379
command: redis-server --appendonly yes --requirepass Fup1sha
volumes:
- fp-redis_data:/data
networks:
- fupisha-api
#Postgresql Database Container
postgresql:
image: postgres:13-alpine
container_name: db
environment:
- POSTGRES_DB=${FUPISHA_STORE_POSTGRESQL_DATABASE}
- POSTGRES_USER=${FUPISHA_STORE_POSTGRESQL_USERNAME}
- POSTGRES_PASSWORD=${FUPISHA_STORE_POSTGRESQL_PASSWORD}
ports:
- "5432:5432"
volumes:
- "fp-pg_data:/data/db" # persist data on the container in a local folder named fp_data. /data/db/ is a folder that already created inside the postgresql container.
networks:
- fupisha-api
volumes:
fp-pg_data:
fp-redis_data:
fupisha:
networks:
fupisha-api:
driver: "bridge"