File tree 4 files changed +41
-16
lines changed
4 files changed +41
-16
lines changed Original file line number Diff line number Diff line change
1
+ node_modules /
2
+ dist /
3
+ .git /
4
+ .gitignore
5
+ README.md
Original file line number Diff line number Diff line change 1
- FROM node:6
1
+ # Use the slim version of the latest Node LTS which includes Yarn
2
+ FROM node:6.10.2-slim
2
3
3
- RUN apt-get update
4
- RUN apt-get install apt-transport-https
4
+ # Docker images have no default editor so we'll use vim
5
+ RUN apt-get update && apt-get install -y \
6
+ vim
5
7
6
- RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
7
- RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
8
-
9
- RUN apt-get update
10
- RUN apt-get install yarn
8
+ # Create an app directory for our app to exist in the docker container
9
+ RUN mkdir -p app
11
10
11
+ # Establish a directory where later commands will be run relative to in the container
12
12
WORKDIR /app
13
13
14
+ # Copy package.json & yarn.lock into our app directory in the container
15
+ COPY package.json \
16
+ yarn.lock \
17
+ # Destination folder
18
+ /app/
19
+
20
+ # Install dependencies in the container
21
+ RUN yarn install
22
+
23
+ # Copy all the rest of our files into the app directory in the container
24
+ COPY . /app
25
+
26
+ # Expose port for webpack
14
27
EXPOSE 8080
Original file line number Diff line number Diff line change @@ -33,14 +33,16 @@ git push origin master
33
33
34
34
## Commands
35
35
36
- Run your tests with:
37
- ```
38
- yarn test
39
- ```
40
36
Run the server with:
41
37
```
42
38
yarn start
43
39
```
40
+
41
+ Run your tests with:
42
+ ```
43
+ yarn test
44
+ ```
45
+
44
46
Run a build with:
45
47
```
46
48
yarn build
@@ -50,7 +52,7 @@ yarn build
50
52
51
53
Build and start the server:
52
54
```
53
- docker-compose up
55
+ docker-compose up --build
54
56
```
55
57
56
58
Run your tests with:
@@ -62,3 +64,8 @@ Run a build with:
62
64
```
63
65
docker-compose exec web yarn build
64
66
```
67
+
68
+ If your terminal closes run:
69
+ ```
70
+ docker-compose logs --follow
71
+ ```
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ services:
4
4
web :
5
5
tty : true
6
6
build : .
7
- command : bash -c " yarn && yarn start"
7
+ command : ' yarn start'
8
8
ports :
9
- - ' 8080:8080'
9
+ - " 8080:8080"
10
10
volumes :
11
- - .:/app:rw
11
+ - .:/app
You can’t perform that action at this time.
0 commit comments