-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
122 lines (121 loc) · 3.58 KB
/
docker-compose.yml
File metadata and controls
122 lines (121 loc) · 3.58 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
# Main docker-compose.yml file.
# -----------------------------
#
# From this file, we include several files related to different part of the application.
# This is done for several seasons:
# - base docker compose config are stored in their respective scope (api, db, or webui)
# - a container can be created from each scope (avoids changing working dir).
#
# More information about usage at the end of the file.
#
#--------------------------------------------------------------------------------------------
#
# Usage:
# ------
#
# Example 1 - for frontend development:
#
# docker compose stop # ensure all containers are stopped
# docker compose up --profile api -d # run the backend (api will run database too)
# cd webui # move to frontend folder
# npm run dev # run dev server
#
# Example 2 - for api development:
#
# docker compose stop # ensure all containers are stopped
# docker compose up --profile webui # run the database and frontend
# cd api # move to the api folder
# source venv/bin/activate # setup environment
# uvicorn main:app --reload # run fastapi application
#
#--------------------------------------------------------------------------------------------
#
name: 'seeking'
services:
#
#--------------------------------------------------------------------------------------------
#
webui:
image: bfresh/seeking-webui
build:
context: webui
restart: on-failure
develop:
watch:
- path: webui/
action: rebuild
ignore: ["webui/.next", "webui/node_modules"]
environment:
- NEXT_PUBLIC_API_BASE_URL=http://0.0.0.0:8000
ports:
- 3000:3000
networks: ['frontend']
#
#--------------------------------------------------------------------------------------------
#
api:
image: bfresh/seeking-api
build:
context: api
develop:
watch:
- path: ./api
action: sync
target: /app
restart: on-failure
ports:
- 8000:8000
networks: ['backend']
environment:
DATABASE_HOST: db
APP_HOST: 0.0.0.0
DATABASE_NAME: seeking
DATABASE_USER: postgres
DATABASE_PASSWORD: postgres
depends_on:
db:
condition: service_healthy # see "healthcheck" in db service
#
#--------------------------------------------------------------------------------------------
#
db:
image: postgres:14
container_name: 'seeking-db'
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: seeking
ports:
- 5432:5432
networks: ['backend']
healthcheck: # See https://docs.docker.com/reference/dockerfile/#healthcheck
test: [ "CMD", "pg_isready", "-q", "-d", "seeking", "-U", "postgres" ]
start_interval: 1s
start_period: 5s
interval: 5s
timeout: 5s
pgadmin:
image: dpage/pgadmin4
container_name: 'seeking-pgadmin'
restart: always
depends_on:
db:
condition: service_healthy # see "healthcheck" in db service
ports:
- "8888:80"
environment:
PGADMIN_DEFAULT_EMAIL: admin@admin.com
PGADMIN_DEFAULT_PASSWORD: weak-for-dev-only
networks: ['backend']
profiles: ['maintenance']
#
#--------------------------------------------------------------------------------------------
#
networks:
frontend:
backend:
#
#--------------------------------------------------------------------------------------------
#