File tree 3 files changed +37
-0
lines changed
3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ node_modules
2
+ dist
Original file line number Diff line number Diff line change
1
+ FROM node:16-alpine
2
+
3
+ WORKDIR /usr/app
4
+
5
+ # first copy just the package and the lock file, for caching purposes
6
+ COPY package.json ./
7
+ COPY yarn.lock ./
8
+
9
+ # install dependencies
10
+ RUN yarn
11
+
12
+ # copy the entire project
13
+ COPY . .
14
+
15
+ # build
16
+ RUN yarn build
17
+
18
+ EXPOSE 3000
19
+ CMD [ "yarn" , "start" ]
Original file line number Diff line number Diff line change 21
21
- You can run ` yarn dev ` to combine the 2 steps above, while listening to changes and restarting automatically.
22
22
- You need to run ` yarn global add ts-node nodemon ` once for this to run.
23
23
24
+ ## Run with Docker
25
+
26
+ 1 . Build:
27
+
28
+ ```
29
+ docker build -t my-app .
30
+ ```
31
+
32
+ Replacing `my-app` with the image name.
33
+
34
+ 2. Run
35
+ ```
36
+ docker run -d -p 3000:3000 my-app
37
+ ```
38
+ Replacing `my-app` with the image name, and `3000:3000` with the `host:container` ports to publish.
39
+
24
40
## Linting & Formatting
25
41
26
42
- Run `yarn lint` to lint the code.
You can’t perform that action at this time.
0 commit comments