Skip to content

Commit 2c14260

Browse files
authored
feat: add Dockerfile (#213)
1 parent 13842e9 commit 2c14260

File tree

15 files changed

+158
-0
lines changed

15 files changed

+158
-0
lines changed

templates/basic-js/.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**/node_modules/
2+
**/.git
3+
**/README.md
4+
**/LICENSE
5+
**/.vscode
6+
**/npm-debug.log
7+
**/coverage
8+
**/.env
9+
**/.editorconfig
10+
**/dist
11+
**/*.pem
12+
Dockerfile

templates/basic-js/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM node:12-slim
2+
WORKDIR /usr/src/app
3+
COPY package.json package-lock.json ./
4+
RUN npm ci --production
5+
RUN npm cache clean --force
6+
ENV NODE_ENV="production"
7+
COPY . .
8+
CMD [ "npm", "start" ]

templates/basic-js/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ npm install
1212
npm start
1313
```
1414

15+
## Docker
16+
17+
```sh
18+
# 1. Build container
19+
docker build -t {{ appName }} .
20+
21+
# 2. Start container
22+
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> {{ appName }}
23+
```
24+
1525
## Contributing
1626

1727
If you have suggestions for how {{ appName }} could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

templates/basic-ts/.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**/node_modules/
2+
**/.git
3+
**/README.md
4+
**/LICENSE
5+
**/.vscode
6+
**/npm-debug.log
7+
**/coverage
8+
**/.env
9+
**/.editorconfig
10+
**/dist
11+
**/*.pem
12+
Dockerfile

templates/basic-ts/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM node:12-slim AS build
2+
WORKDIR /usr/src/app
3+
COPY package.json package-lock.json ./
4+
RUN npm ci
5+
COPY . .
6+
RUN npm run build
7+
8+
FROM node:12-slim
9+
WORKDIR /usr/src/app
10+
COPY package.json package-lock.json ./
11+
RUN npm ci
12+
RUN npm cache clean --force
13+
COPY --from=build /usr/src/app/lib lib
14+
15+
ENV NODE_ENV="production"
16+
CMD [ "npm", "start" ]

templates/basic-ts/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ npm run build
1515
npm run start
1616
```
1717

18+
## Docker
19+
20+
```sh
21+
# 1. Build container
22+
docker build -t {{ appName }} .
23+
24+
# 2. Start container
25+
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> {{ appName }}
26+
```
27+
1828
## Contributing
1929

2030
If you have suggestions for how {{ appName }} could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

templates/checks-js/.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**/node_modules/
2+
**/.git
3+
**/README.md
4+
**/LICENSE
5+
**/.vscode
6+
**/npm-debug.log
7+
**/coverage
8+
**/.env
9+
**/.editorconfig
10+
**/dist
11+
**/*.pem
12+
Dockerfile

templates/checks-js/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM node:12-slim
2+
WORKDIR /usr/src/app
3+
COPY package.json package-lock.json ./
4+
RUN npm ci --production
5+
RUN npm cache clean --force
6+
ENV NODE_ENV="production"
7+
COPY . .
8+
CMD [ "npm", "start" ]

templates/checks-js/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ npm install
1212
npm start
1313
```
1414

15+
## Docker
16+
17+
```sh
18+
# 1. Build container
19+
docker build -t {{ appName }} .
20+
21+
# 2. Start container
22+
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> {{ appName }}
23+
```
24+
1525
## Contributing
1626

1727
If you have suggestions for how {{ appName }} could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

templates/deploy-js/.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**/node_modules/
2+
**/.git
3+
**/README.md
4+
**/LICENSE
5+
**/.vscode
6+
**/npm-debug.log
7+
**/coverage
8+
**/.env
9+
**/.editorconfig
10+
**/dist
11+
**/*.pem
12+
Dockerfile

0 commit comments

Comments
 (0)