Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10-put it in docker #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:latest

WORKDIR /usr/src/app

COPY package*.json ./
RUN npm install

COPY . .
RUN npm run-script build

CMD [ "npm", “run”, "start:prod" ]

EXPOSE 3000

USER node
8 changes: 8 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:latest

WORKDIR /usr/src/app
ENV PORT 3000
EXPOSE 3000
USER node

ENTRYPOINT /bin/bash
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,31 @@
A slack bot to make retros in Slack easier

Uses https://github.com/slackapi/node-slack-sdk


## Docker
Retro-bot can be run in Docker.
There is a Docker-file for production and one for development.
There is also a docker-compose file for development.

### docker-compose for development
#### Setup
```
> docker-compose up # creates all the docker stuff
> docker-compose down # cleans up afterward
```
#### use
This sets up a shell with a dev environment.
```
> docker-compose run --rm -p 3000:3000 retrobot_dev
```
Then you can run your commands to start the server in watch mode.
```
> npm start
```


If you need to change the Dockerfile compose can rebuild it using.
```
> docker-compse build
```
14 changes: 14 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3"

services:
retrobot_dev:
build:
context: .
dockerfile: Dockerfile.dev
environment:
ENV_NAME: dev
container_name: retro-bot-dev
ports:
- 3000:3000
volumes:
- ./:/usr/src/app
6 changes: 6 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"watch": ["src"],
"ext": "ts",
"ignore": ["src/**/*.spec.ts"],
"exec": "ts-node ./src/index.ts"
}
Loading