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

Suporte a Docker para desenvolvimento local #43

Merged
merged 5 commits into from
Sep 14, 2022
Merged
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
npm-debug.log
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js}]
charset = utf-8
indent_style = space
indent_size = 2

# Tab indentation (no size specified)
[Makefile]
indent_style = tab

# Indentation override for all JS under assets/phrases directory
[assets/phrases/**.json]
indent_style = space
indent_size = 2

# Matches the exact files either package.json or .travis.yml
[{package.json,.gitpod.yml,docker-compose.yaml}]
indent_style = space
indent_size = 2

18 changes: 18 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Specify the parent image from which we build
FROM node:18.9.0-alpine3.16

ENV NODE_ENV=development

# Set the working directory
RUN mkdir -p /usr/src/welcome_bot
WORKDIR /usr/src/welcome_bot

# Install app dependencies
COPY package*.json ./

RUN npm install
RUN npm install -g nodemon
COPY . .

# Run the application
CMD [ "npm", "run", "start.dev" ]
10 changes: 10 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3'

services:
app:
build:
context: .
dockerfile: Dockerfile.dev
volumes:
- ./:/usr/src/welcome_bot:cached
- /usr/src/welcome_bot/node_modules
43 changes: 22 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
{
"scripts": {
"start": "node index.js",
"lint": "eslint .",
"test": "cross-env BABEL_ENV=test jest --passWithNoTests",
"format": "prettier --write .",
"prepare": "husky install"
"start": "node index.js",
"start.dev": "nodemon -L --inspect=0.0.0.0 index.js",
"lint": "eslint .",
"test": "cross-env BABEL_ENV=test jest --passWithNoTests",
"format": "prettier --write .",
"prepare": "husky install"
},
"dependencies": {
"discord.js": "^13.8.0",
"dotenv": "^16.0.1"
"discord.js": "^13.8.0",
"dotenv": "^16.0.1"
},
"devDependencies": {
"@types/jest": "28.1.6",
"cross-env": "7.0.3",
"eslint": "8.20.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "8.0.1",
"jest": "28.1.3",
"jest-cli": "28.1.3",
"prettier": "2.7.1"
"@types/jest": "28.1.6",
"cross-env": "7.0.3",
"eslint": "8.20.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "8.0.1",
"jest": "28.1.3",
"jest-cli": "28.1.3",
"prettier": "2.7.1"
}
}