-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0c7565
commit f57d330
Showing
40 changed files
with
11,192 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#Environment | ||
NODE_ENV=development | ||
|
||
# Express | ||
PORT=3000 | ||
|
||
# JWT Secret | ||
JWT_SECRET=jwtsecret | ||
|
||
# Mongoose | ||
MONGODB_URL=mongodb://mongodb:27017/radioju-development | ||
|
||
# Redis | ||
REDIS_HOST=redis | ||
REDIS_PORT=6379 | ||
REDIS_PASSWORD=redispassword |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"env": { | ||
"node": true | ||
}, | ||
"extends": [ | ||
"airbnb-base", | ||
"plugin:security/recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"plugins": ["security", "prettier"], | ||
"parserOptions": { | ||
"ecmaVersion": 2018 | ||
}, | ||
"rules": { | ||
"no-console": "off", | ||
"func-names": "off", | ||
"no-underscore-dangle": "off", | ||
"consistent-return": "off", | ||
"security/detect-object-injection": "off", | ||
"security/detect-non-literal-require": "off", | ||
"import/no-dynamic-require": "off", | ||
"global-require": "off", | ||
"security/detect-non-literal-fs-filename": "off", | ||
"class-methods-use-this": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"hooks": { | ||
"post-checkout": "yarn", | ||
"pre-commit": "npx lint-staged", | ||
"post-commit": "git status" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"*.js": "eslint" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
coverage | ||
logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"singleQuote": true, | ||
"printWidth": 120, | ||
"jsdocParser": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM node:16-alpine | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/radioju-api | ||
|
||
# Install app dependencies | ||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
# where available (npm@5+) | ||
COPY package*.json ./ | ||
|
||
# npm i bcrypt needed python3 | ||
RUN apk --no-cache add --virtual .builds-deps build-base python3 | ||
|
||
RUN npm install | ||
# If you are building your code for production | ||
# RUN npm ci --only=production | ||
|
||
# Bundle app source | ||
COPY . . | ||
|
||
EXPOSE 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# radioju-api | ||
# radioju-api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
version: '3' | ||
|
||
services: | ||
redis: | ||
image: redis:6.2-alpine | ||
ports: | ||
- 6379:6379 | ||
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD} | ||
networks: | ||
- redis | ||
|
||
mongodb: | ||
image: mongo:5.0.6 | ||
ports: | ||
- 27017:27017 | ||
volumes: | ||
- mongodb:/data/db | ||
networks: | ||
- mongodb | ||
|
||
api: | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile | ||
environment: | ||
- MONGODB_URL=${MONGODB_URL} | ||
- NODE_ENV=${NODE_ENV} | ||
- JWT_SECRET=${JWT_SECRET} | ||
- REDIS_HOST=${REDIS_HOST} | ||
- REDIS_PORT=${REDIS_PORT} | ||
- REDIS_PASSWORD=${REDIS_PASSWORD} | ||
ports: | ||
- '3000:3000' | ||
depends_on: | ||
- redis | ||
- mongodb | ||
volumes: | ||
- api:/usr/src/radioju-api | ||
- storage:/usr/src/radioju-api/storage | ||
networks: | ||
- api | ||
- redis | ||
- mongodb | ||
command: yarn start | ||
|
||
volumes: | ||
api: | ||
driver: local | ||
storage: | ||
driver: local | ||
name: radioju-storage | ||
mongodb: | ||
driver: local | ||
|
||
networks: | ||
api: | ||
driver: bridge | ||
name: nginx-bridge | ||
redis: | ||
driver: ipvlan | ||
mongodb: | ||
driver: ipvlan | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
apps: [ | ||
{ | ||
name: 'radioju-api', | ||
script: 'src/bin/www', | ||
watch: false, | ||
autorestart: true, | ||
time: false, | ||
env: { | ||
NODE_ENV: 'production', | ||
}, | ||
}, | ||
], | ||
}; |
Oops, something went wrong.