forked from mohamedsamara/mern-ecommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
50 lines (47 loc) · 1.11 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
services:
mongodb:
image: mongo:latest
ports:
- '27017:27017'
environment:
MONGO_INITDB_DATABASE: mern_ecommerce
volumes:
- mongodb_data:/data/db
app:
build:
context: .
dockerfile: Dockerfile
ports:
- '3000:3000'
- '8080:8080'
- '5000:5000'
environment:
- MONGO_URI=mongodb://mongodb:27017/mern_ecommerce
- NODE_OPTIONS=--openssl-legacy-provider
- API_URL=http://localhost:3000/api
- CLIENT_URL=http://localhost:8080
- JWT_SECRET=secret123
depends_on:
- mongodb
- db-seed
volumes:
- ./tmp:/app/tmp
- ./:/app
db-seed:
build:
context: .
dockerfile: Dockerfile
environment:
- MONGO_URI=mongodb://mongodb:27017/mern_ecommerce
- NODE_OPTIONS=--openssl-legacy-provider
- API_URL=http://localhost:3000/api
- CLIENT_URL=http://localhost:8080
- JWT_SECRET=secret123
depends_on:
- mongodb
command: >
sh -c "cd server && npm run seed:db -- [email protected] strongpassword"
volumes:
- ./:/app
volumes:
mongodb_data: