-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yaml
108 lines (101 loc) · 2.37 KB
/
docker-compose.yaml
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
services:
frontend:
container_name: frontend
image: node:18-alpine
restart: always
ports:
- protocol: tcp
published: ${FRONTEND_PORT:-80}
target: 5173
volumes:
- type: bind
source: ./frontend
target: /app
working_dir: /app
command: [ 'npm', 'run', 'dev' ]
user: "${USER_ID:-0}:${GROUP_ID:-0}"
depends_on:
frontend-npm:
condition: service_completed_successfully
networks:
- frontend
backend:
container_name: backend
image: node:18-alpine
restart: always
ports:
- protocol: tcp
published: ${BACKEND_PORT:-8080}
target: 3000
volumes:
- type: bind
source: ./backend
target: /app
working_dir: /app
command: [ 'npm', 'start' ]
user: "${USER_ID:-0}:${GROUP_ID:-0}"
depends_on:
backend-npm:
condition: service_completed_successfully
networks:
- backend
dynamodb:
container_name: dynamodb
image: amazon/dynamodb-local:latest
restart: always
ports:
- protocol: tcp
published: ${DYNAMODB_PORT:-8000}
target: 8000
volumes:
- type: volume
source: dynamodb
target: /home/dynamodblocal/data
command: [ '-jar', 'DynamoDBLocal.jar', '-dbPath', '/home/dynamodblocal/data', '-sharedDb' ]
user: "${USER_ID:-0}:${GROUP_ID:-0}"
networks:
- backend
dynamodb-admin:
container_name: dynamodb-admin
build:
context: ./docker/dynamodb-admin
restart: always
ports:
- protocol: tcp
published: ${DYNAMODB_ADMIN_PORT:-8001}
target: 8001
networks:
- backend
- frontend
environment:
- DYNAMO_ENDPOINT=http://dynamodb:8000
command: [ 'dynamodb-admin' ]
backend-npm:
image: node:18-alpine
container_name: backend-npm
volumes:
- type: bind
source: ./backend
target: /app
working_dir: /app
restart: "no"
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
command: [ 'npm', 'i' ]
frontend-npm:
image: node:18-alpine
container_name: frontend-npm
volumes:
- type: bind
source: ./frontend
target: /app
working_dir: /app
restart: "no"
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
command: [ 'npm', 'i' ]
volumes:
dynamodb: {}
networks:
frontend:
driver: bridge
backend:
driver: bridge