Skip to content

Commit

Permalink
feat: add Dockerfile (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
FoseFx authored Oct 13, 2020
1 parent 13842e9 commit 2c14260
Show file tree
Hide file tree
Showing 15 changed files with 158 additions and 0 deletions.
12 changes: 12 additions & 0 deletions templates/basic-js/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**/node_modules/
**/.git
**/README.md
**/LICENSE
**/.vscode
**/npm-debug.log
**/coverage
**/.env
**/.editorconfig
**/dist
**/*.pem
Dockerfile
8 changes: 8 additions & 0 deletions templates/basic-js/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:12-slim
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci --production
RUN npm cache clean --force
ENV NODE_ENV="production"
COPY . .
CMD [ "npm", "start" ]
10 changes: 10 additions & 0 deletions templates/basic-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ npm install
npm start
```

## Docker

```sh
# 1. Build container
docker build -t {{ appName }} .

# 2. Start container
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> {{ appName }}
```

## Contributing

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.
Expand Down
12 changes: 12 additions & 0 deletions templates/basic-ts/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**/node_modules/
**/.git
**/README.md
**/LICENSE
**/.vscode
**/npm-debug.log
**/coverage
**/.env
**/.editorconfig
**/dist
**/*.pem
Dockerfile
16 changes: 16 additions & 0 deletions templates/basic-ts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:12-slim AS build
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:12-slim
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci
RUN npm cache clean --force
COPY --from=build /usr/src/app/lib lib

ENV NODE_ENV="production"
CMD [ "npm", "start" ]
10 changes: 10 additions & 0 deletions templates/basic-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ npm run build
npm run start
```

## Docker

```sh
# 1. Build container
docker build -t {{ appName }} .

# 2. Start container
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> {{ appName }}
```

## Contributing

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.
Expand Down
12 changes: 12 additions & 0 deletions templates/checks-js/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**/node_modules/
**/.git
**/README.md
**/LICENSE
**/.vscode
**/npm-debug.log
**/coverage
**/.env
**/.editorconfig
**/dist
**/*.pem
Dockerfile
8 changes: 8 additions & 0 deletions templates/checks-js/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:12-slim
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci --production
RUN npm cache clean --force
ENV NODE_ENV="production"
COPY . .
CMD [ "npm", "start" ]
10 changes: 10 additions & 0 deletions templates/checks-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ npm install
npm start
```

## Docker

```sh
# 1. Build container
docker build -t {{ appName }} .

# 2. Start container
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> {{ appName }}
```

## Contributing

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.
Expand Down
12 changes: 12 additions & 0 deletions templates/deploy-js/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**/node_modules/
**/.git
**/README.md
**/LICENSE
**/.vscode
**/npm-debug.log
**/coverage
**/.env
**/.editorconfig
**/dist
**/*.pem
Dockerfile
8 changes: 8 additions & 0 deletions templates/deploy-js/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:12-slim
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci --production
RUN npm cache clean --force
ENV NODE_ENV="production"
COPY . .
CMD [ "npm", "start" ]
10 changes: 10 additions & 0 deletions templates/deploy-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ npm install
npm start
```

## Docker

```sh
# 1. Build container
docker build -t {{ appName }} .

# 2. Start container
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> {{ appName }}
```

## Contributing

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.
Expand Down
12 changes: 12 additions & 0 deletions templates/git-data-js/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**/node_modules/
**/.git
**/README.md
**/LICENSE
**/.vscode
**/npm-debug.log
**/coverage
**/.env
**/.editorconfig
**/dist
**/*.pem
Dockerfile
8 changes: 8 additions & 0 deletions templates/git-data-js/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:12-slim
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci --production
RUN npm cache clean --force
ENV NODE_ENV="production"
COPY . .
CMD [ "npm", "start" ]
10 changes: 10 additions & 0 deletions templates/git-data-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ npm install
npm start
```

## Docker

```sh
# 1. Build container
docker build -t {{ appName }} .

# 2. Start container
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> {{ appName }}
```

## Contributing

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.
Expand Down

0 comments on commit 2c14260

Please sign in to comment.