generated from Libertech-FR/template_nestjs
-
Notifications
You must be signed in to change notification settings - Fork 2
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
0 parents
commit 87219ea
Showing
42 changed files
with
8,784 additions
and
0 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,8 @@ | ||
node_modules/ | ||
dist/ | ||
.DS_Store/ | ||
.idea/ | ||
.env | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.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,17 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
max_line_length = 120 | ||
|
||
[Makefile] | ||
indent_style = tab | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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 @@ | ||
APPNAME=template | ||
|
||
MONGOOSE_URL=mongodb://template-mongodb:27017/myreport | ||
IOREDIS_URL=redis://template-redis:6379/1 | ||
|
||
JWT_SECRET=1212974 | ||
CRYPT_SECURITYKEY=78987946 | ||
|
||
PASSPORT_LDAP_URL=ldap://template-openldap:389 | ||
PASSPORT_LDAP_BINDDN=cn=admin,dc=test,dc=local | ||
PASSPORT_LDAP_BINDCREDENTIALS= | ||
PASSPORT_LDAP_SEARCHBASE=dc=test,dc=local | ||
LDAP_LOG_LEVEL=trace | ||
|
||
MAILER_TRANSPORT_HOST=template-maildev | ||
MAILER_TRANSPORT_PORT=1025 | ||
MAILER_TRANSPORT_SECURE=0 | ||
MAILER_TRANSPORT_IGNORETLS=0 | ||
MAILER_TRANSPORT_AUTHUSER='' | ||
MAILER_TRANSPORT_AUTHPASS='' | ||
MAILER_DEFAULTS_FROM="'test' <[email protected]>" |
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,27 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
sourceType: 'module', | ||
}, | ||
plugins: ['@typescript-eslint/eslint-plugin'], | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
root: true, | ||
env: { | ||
node: true, | ||
}, | ||
ignorePatterns: ['.eslintrc.js'], | ||
rules: { | ||
'no-console': 0, | ||
'comma-dangle': [2, 'always-multiline'], | ||
'@typescript-eslint/interface-name-prefix': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-inferrable-types': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-var-requires': '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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build docker Nuxt | ||
uses: Libertech-FR/lt-actions/docker-image@main | ||
with: | ||
repository: ${{ github.repository }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} |
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,18 @@ | ||
name: Update Time Spent On Issues | ||
|
||
on: | ||
issue_comment: | ||
types: [created, edited] | ||
|
||
jobs: | ||
get-comments: | ||
if: ${{ startsWith(github.event.comment.body, '!spend') }} | ||
runs-on: ubuntu-latest | ||
outputs: | ||
comments: ${{ steps.generate-matrix.outputs.comments }} | ||
|
||
steps: | ||
- name: Time spent control | ||
uses: Libertech-FR/lt-actions/issue-spend@main | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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,47 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version_increment: | ||
description: 'La version a incrémenter (major, minor, patch)' | ||
required: true | ||
default: 'patch' | ||
type: choice | ||
options: | ||
- 'major' | ||
- 'minor' | ||
- 'patch' | ||
build_docker_image: | ||
description: "Construire l'image docker ?" | ||
required: true | ||
default: true | ||
type: boolean | ||
latest: | ||
description: "Tagger l'image docker avec le tag 'latest' ?" | ||
required: true | ||
default: true | ||
type: boolean | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
steps: | ||
- name: Build docker | ||
uses: Libertech-FR/lt-actions/release@main | ||
with: | ||
version_increment: ${{ github.event.inputs.version_increment }} | ||
build_docker_image: ${{ github.event.inputs.build_docker_image }} | ||
latest: ${{ github.event.inputs.latest }} | ||
repository: ${{ github.repository }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# Optional parameters, thoses are default values : | ||
registry: 'ghcr.io' | ||
context: . |
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,8 @@ | ||
node_modules/ | ||
dist/ | ||
.DS_Store/ | ||
.idea/ | ||
.env | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.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,8 @@ | ||
node_modules/ | ||
dist/ | ||
.DS_Store/ | ||
.idea/ | ||
.env | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.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 @@ | ||
{ | ||
"useTabs": false, | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"arrowParens": "always", | ||
"printWidth": 120, | ||
"bracketSpacing": 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,44 @@ | ||
FROM node:18.14.0-alpine AS builder | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY . . | ||
|
||
RUN apk add git && yarn install \ | ||
--prefer-offline \ | ||
--frozen-lockfile \ | ||
--non-interactive \ | ||
--production=false | ||
|
||
RUN yarn run build | ||
|
||
FROM node:18.14.0-alpine AS production | ||
|
||
ARG NODE_ENV=production | ||
ENV NODE_ENV=${NODE_ENV} | ||
|
||
WORKDIR /usr/src/app | ||
|
||
ADD Makefile . | ||
ADD package.json . | ||
ADD *.lock . | ||
|
||
RUN apk add --no-cache \ | ||
openssl \ | ||
git \ | ||
jq \ | ||
nano | ||
|
||
RUN yarn install \ | ||
--prefer-offline \ | ||
--pure-lockfile \ | ||
--non-interactive \ | ||
--production=true | ||
|
||
#COPY . . | ||
|
||
COPY --from=builder /usr/src/app/dist ./dist | ||
|
||
EXPOSE 4000 | ||
|
||
CMD ["yarn", "start:prod"] |
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,109 @@ | ||
IMGNAME?=exemple | ||
APPNAME?=exemple | ||
APPPORT?=4500 | ||
|
||
LDAPORGANISATION?=exemple | ||
LDAPDOMAIN?=exemple.local | ||
LDAPPASSWORD?= | ||
OPENLDAP_PORT?=389 | ||
|
||
MAILDEVPORTWEB?=1080 | ||
MAILDEVPORTMAIL?=1025 | ||
|
||
init: | ||
@docker build -t $(IMGNAME) . | ||
@docker exec -it $(APPNAME) yarn install | ||
|
||
build: | ||
docker build -t $(IMGNAME) . | ||
|
||
push: | ||
docker push $(IMGNAME) | ||
|
||
compile: | ||
docker exec -it $(APPNAME) yarn build | ||
|
||
dev: | ||
@docker run -it --rm \ | ||
-e NODE_ENV=development \ | ||
-e NODE_TLS_REJECT_UNAUTHORIZED=0 \ | ||
--add-host host.docker.internal:host-gateway \ | ||
--name $(APPNAME) \ | ||
--network dev \ | ||
-p $(APPPORT):4000 \ | ||
-v $(CURDIR):/usr/src/app \ | ||
$(IMGNAME) yarn start:dev | ||
|
||
exec: | ||
@docker run -it --rm \ | ||
--add-host host.docker.internal:host-gateway \ | ||
-e NODE_ENV=development \ | ||
--network dev \ | ||
-v $(CURDIR):/usr/src/app \ | ||
$(IMGNAME) sh | ||
|
||
generate: | ||
@docker exec -it $(APPNAME) yarn generate | ||
|
||
dbs: | ||
@docker run --rm -d \ | ||
--name $(APPNAME)-openldap \ | ||
-e LDAP_ORGANISATION=$(LDAPORGANISATION) \ | ||
-e LDAP_DOMAIN=$(LDAPDOMAIN) \ | ||
-e LDAP_ADMIN_PASSWORD=$(LDAPPASSWORD) \ | ||
--network dev \ | ||
-v $(CURDIR)/openldap/custom:/container/service/slapd/assets/config/bootstrap/ldif/custom \ | ||
-p $(OPENLDAP_PORT):389 \ | ||
osixia/openldap:1.5.0 --loglevel debug --copy-service | ||
|
||
@docker volume create $(APPNAME)-redis | ||
@docker run -d --rm \ | ||
--name $(APPNAME)-redis \ | ||
--network dev \ | ||
-p 6379:6379 \ | ||
redis | ||
@docker volume create $(APPNAME)-mongodb | ||
@docker run -d --rm \ | ||
--name $(APPNAME)-mongodb \ | ||
-v $(APPNAME)-mongodb:/data/db \ | ||
-p 27017:27017 \ | ||
--network dev \ | ||
mongo:5.0 --wiredTigerCacheSizeGB 1.5 --quiet || true | ||
|
||
@docker run --rm -d \ | ||
--name $(APPNAME)-ldapadmin \ | ||
-e PHPLDAPADMIN_LDAP_HOSTS=ga.service.usermanager.openldap \ | ||
-e PHPLDAPADMIN_LDAP_HOSTS="#PYTHON2BASH:[{'$(APPNAME)-openldap': [{'login': [{'bind_id': 'cn=admin,dc=test,dc=local'}]}]}]" \ | ||
-v $(CURDIR)/phpldapadmin/exemples/:/data/exemples \ | ||
-p 6443:443 \ | ||
--network dev \ | ||
osixia/phpldapadmin || true | ||
|
||
@docker run --rm -d --name $(APPNAME)-maildev \ | ||
-p $(MAILDEVPORTWEB):1080 \ | ||
-p $(MAILDEVPORTMAIL):1025 \ | ||
--network dev \ | ||
maildev/maildev || true | ||
|
||
stop: | ||
@docker stop $(APPNAME)-maildev || true | ||
@docker stop $(APPNAME)-ldapadmin || true | ||
@docker stop $(APPNAME)-mongodb || true | ||
@docker stop $(APPNAME)-redis || true | ||
@docker stop $(APPNAME)-openldap || true | ||
@docker stop $(APPNAME) || true | ||
|
||
rm: | ||
docker rm $(shell docker ps -a -q -f name=$(APPNAME)) | ||
|
||
|
||
openldap: | ||
docker run --rm -it \ | ||
--name $(APPNAME)-openldap \ | ||
-e LDAP_ORGANISATION=$(LDAPORGANISATION) \ | ||
-e LDAP_DOMAIN=$(LDAPDOMAIN) \ | ||
-e LDAP_ADMIN_PASSWORD=$(LDAPPASSWORD) \ | ||
--network dev \ | ||
-v $(CURDIR)/openldap/custom:/container/service/slapd/assets/config/bootstrap/ldif/custom \ | ||
-p $(OPENLDAP_PORT):389 \ | ||
osixia/openldap:1.5.0 --loglevel trace --copy-service |
Oops, something went wrong.