-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
57 lines (43 loc) · 1.39 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
services:
postgres:
image: postgres
container_name: postgr
environment:
POSTGRES_PASSWORD: pass
POSTGRES_USER: username
POSTGRES_DB: database
networks:
- mynetwork
volumes:
- postgres_data:/var/lib/postgresql/data # after re-runnig DB-container we wont lose DB's data , and they will save in hard disk , bc inside of docker is connected to outside of docker
# informations inside the docker , will be saved outside of docker as well , so they wont be deleted
webapp:
image: webapp
container_name: quart_webapp
build:
context: .
dockerfile: ./Dockerfile
networks:
- mynetwork
ports:
- "8080:5000"
volumes:
- ".:/app"
depends_on:
- postgres
api_app:
image: fastapi
container_name: api_app
networks:
- mynetwork
volumes:
- ".:/app"
networks:
mynetwork :
volumes:
postgres_data:
# docker run --network mynetwork --name postgr -e POSTGRES_PASSWORD=pass -e POSTGRES_USER=username -e POSTGRES_DB=database -d postgres
# docker run -v .:/app -p 8080:5000 --network mynetwork webapp
# .:/app
# . means current folder outside docker مسیر بیرون داکر و فایل های فعلی
# /app means , current folder inside docker درون داکر فایل این مسیر رو تعریف کردیم به عنوان فولدری به نام اپ