-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md
76 lines (64 loc) · 1.26 KB
/
README.md
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
## Dockerize development environment for MERN stack
### How to intall
- Install `DockerCE`
- Run command: `docker-compose up`
### MERN Stack
#### Server: Node.js
- Express server
- Nodemon watcher
- Morgan logger
- Sequelize ORM with MySQL driver
#### Webapp: React
- `create-react-app` v2
- React Router DOM
- Hot module reload
#### Database: MySQL 5.7
- Built in database server
### Docker
- docker-compose:
```
version: "3"
services:
api:
build:
context: ./server
links:
- database:database
expose:
- 3000
ports:
- 3000:3000
image: server-dev
container_name: server-dev
volumes:
- ./server/src:/root/src/api/src
tty: true
web:
build:
context: ./webapp
expose:
- 3001
ports:
- 3001:3001
image: web-dev
container_name: web-dev
volumes:
- ./webapp/src:/root/src/app/src
- ./webapp/public:/root/src/app/public
tty: true
database:
image: mysql:5.7
container_name: db-dev
restart: always
environment:
MYSQL_DATABASE: "example_dbname"
MYSQL_USER: "username"
MYSQL_PASSWORD: "password"
MYSQL_ROOT_PASSWORD: "password"
expose:
- 3306
ports:
- 3306:3306
volumes:
- ./mysql:/var/lib/mysql
```