-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.backend.yml
More file actions
131 lines (126 loc) · 3.49 KB
/
Copy pathdocker-compose.backend.yml
File metadata and controls
131 lines (126 loc) · 3.49 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
123
124
125
126
127
128
129
130
131
services:
# -----------------------------
# DynamoDB Local
# -----------------------------
dynamo:
image: amazon/dynamodb-local
container_name: dynamo
command: "-jar DynamoDBLocal.jar -sharedDb -dbPath /data2"
ports:
- "8000:8000"
volumes:
- ./local/dynamo:/data2
healthcheck:
test: ["CMD-SHELL", "curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8000 | grep -q 400 || exit 1"]
interval: 5s
timeout: 3s
retries: 10
start_period: 5s
networks:
- localstack-net
# -----------------------------
# S3 Local
# -----------------------------
localstack:
image: localstack/localstack:3.2.0
container_name: localstack
ports:
- "4566:4566"
- "4571:4571"
environment:
- SERVICES=s3
- DEBUG=1
- PERSISTENCE=1
- LS_PERSISTENCE=1
- LS_LOG=debug
volumes:
- ./local/localstack:/var/lib/localstack
- /var/run/docker.sock:/var/run/docker.sock
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4566/_localstack/health"]
interval: 5s
timeout: 3s
retries: 10
start_period: 5s
networks:
- localstack-net
backend:
build:
context: ./FoodTok_Backend
dockerfile: Dockerfile.backend
container_name: backend
environment:
- IS_LOCAL=true
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
- AWS_REGION=us-east-1
- DDB_USERS_TABLE=Users
- DDB_RESTAURANTS_TABLE=Restaurants
- DDB_FAVORITES_TABLE=Favorites
- DDB_RESERVATIONS_TABLE=Reservations
- DDB_USER_STATS_TABLE=UserStats
- DDB_HOLDS_TABLE=Holds
- S3_IMAGES_BUCKET=foodtok-local-images
- LOCAL_DYNAMO_ENDPOINT=http://dynamo:8000
- LOCAL_S3_ENDPOINT=http://localstack:4566
- DJANGO_SETTINGS_MODULE=ecs_project.settings
ports:
- "8080:8080"
command: >
sh -c "python manage.py runserver 0.0.0.0:8080"
depends_on:
- dynamo
- localstack
- local_config
networks:
- localstack-net
local_config:
build:
context: ./FoodTok_Backend/local_build
dockerfile: Dockerfile.local_config
container_name: local_config
environment:
- IS_LOCAL=true
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
- AWS_REGION=us-east-1
- DDB_USERS_TABLE=Users
- DDB_RESTAURANTS_TABLE=Restaurants
- DDB_FAVORITES_TABLE=Favorites
- DDB_RESERVATIONS_TABLE=Reservations
- DDB_USER_STATS_TABLE=UserStats
- DDB_HOLDS_TABLE=Holds
- S3_IMAGES_BUCKET=foodtok-local-images
- LOCAL_DYNAMO_ENDPOINT=http://dynamo:8000
- LOCAL_S3_ENDPOINT=http://localstack:4566
- DJANGO_SETTINGS_MODULE=ecs_project.settings
command: ["python", "/app/local_build/local_config.py"]
depends_on:
dynamo:
condition: service_healthy
localstack:
condition: service_healthy
networks:
- localstack-net
# -----------------------------
# DynamoDB Admin GUI
# -----------------------------
dynamodb-admin:
image: aaronshaf/dynamodb-admin
container_name: dynamodb-admin
ports:
- "8001:8001"
environment:
- DYNAMO_ENDPOINT=http://dynamo:8000
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
- AWS_REGION=us-east-1
depends_on:
dynamo:
condition: service_healthy
networks:
- localstack-net
networks:
localstack-net:
name: localstack-net
driver: bridge