docker support
This commit is contained in:
parent
3d97f6659e
commit
5a40b44dd1
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@ -0,0 +1,7 @@
|
||||
devdocker/
|
||||
dist/
|
||||
node_modules/
|
||||
private/
|
||||
*.toml
|
||||
uploads/*
|
||||
.env
|
50
Dockerfile
Normal file
50
Dockerfile
Normal file
@ -0,0 +1,50 @@
|
||||
###################
|
||||
# BUILD FOR LOCAL DEVELOPMENT
|
||||
###################
|
||||
|
||||
FROM node:18-alpine As development
|
||||
|
||||
USER node
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY --chown=node:node package*.json ./
|
||||
|
||||
RUN npm ci
|
||||
|
||||
COPY --chown=node:node . .
|
||||
|
||||
###################
|
||||
# BUILD FOR PRODUCTION
|
||||
###################
|
||||
|
||||
FROM node:18-alpine As build
|
||||
|
||||
USER node
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY --chown=node:node package*.json ./
|
||||
COPY --chown=node:node --from=development /usr/src/app/node_modules ./node_modules
|
||||
COPY --chown=node:node . .
|
||||
|
||||
RUN npm run build
|
||||
|
||||
ENV NODE_ENV production
|
||||
|
||||
RUN npm ci --omit=dev && npm cache clean --force
|
||||
|
||||
###################
|
||||
# PRODUCTION
|
||||
###################
|
||||
|
||||
FROM node:18-alpine As production
|
||||
|
||||
USER node
|
||||
WORKDIR /app
|
||||
|
||||
COPY --chown=node:node --from=build /usr/src/app/node_modules ./node_modules
|
||||
COPY --chown=node:node --from=build /usr/src/app/dist ./dist
|
||||
COPY --chown=node:node --from=build /usr/src/app/views ./views
|
||||
COPY --chown=node:node --from=build /usr/src/app/public ./public
|
||||
COPY --chown=node:node --from=build /usr/src/app/package*.json ./package*.json
|
||||
|
||||
CMD [ "node", "dist/main.js" ]
|
11
package-lock.json
generated
11
package-lock.json
generated
@ -9,7 +9,7 @@
|
||||
"version": "0.0.1",
|
||||
"license": "UNLICENSED",
|
||||
"dependencies": {
|
||||
"@icynet/oauth2-provider": "git+https://gitlab.icynet.eu/IcyNetwork/oauth2-provider.git",
|
||||
"@icynet/oauth2-provider": "^1.0.6",
|
||||
"@nestjs/common": "^9.0.11",
|
||||
"@nestjs/core": "^9.0.11",
|
||||
"@nestjs/platform-express": "^9.0.11",
|
||||
@ -2143,8 +2143,8 @@
|
||||
},
|
||||
"node_modules/@icynet/oauth2-provider": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "git+https://gitlab.icynet.eu/IcyNetwork/oauth2-provider.git#ef4a5abac9f3cc2ef9e5476ea3b4ae28e337cb8c",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/@icynet/oauth2-provider/-/oauth2-provider-1.0.6.tgz",
|
||||
"integrity": "sha512-CsPQZB0Jbzxll4re34aPtZFVNkeeWtC4aW9UZCg8U57fPL8/Xe/2dfnigxdn4r9jVdd6d/qiFSh5x7wrFUmYrw==",
|
||||
"dependencies": {
|
||||
"express": "^4.17.3",
|
||||
"express-session": "^1.17.2"
|
||||
@ -14155,8 +14155,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@icynet/oauth2-provider": {
|
||||
"version": "git+https://gitlab.icynet.eu/IcyNetwork/oauth2-provider.git#ef4a5abac9f3cc2ef9e5476ea3b4ae28e337cb8c",
|
||||
"from": "@icynet/oauth2-provider@git+https://gitlab.icynet.eu/IcyNetwork/oauth2-provider.git",
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@icynet/oauth2-provider/-/oauth2-provider-1.0.6.tgz",
|
||||
"integrity": "sha512-CsPQZB0Jbzxll4re34aPtZFVNkeeWtC4aW9UZCg8U57fPL8/Xe/2dfnigxdn4r9jVdd6d/qiFSh5x7wrFUmYrw==",
|
||||
"requires": {
|
||||
"express": "^4.17.3",
|
||||
"express-session": "^1.17.2"
|
||||
|
@ -24,7 +24,7 @@
|
||||
"test:e2e": "jest --config ./test/jest-e2e.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@icynet/oauth2-provider": "git+https://gitlab.icynet.eu/IcyNetwork/oauth2-provider.git",
|
||||
"@icynet/oauth2-provider": "^1.0.6",
|
||||
"@nestjs/common": "^9.0.11",
|
||||
"@nestjs/core": "^9.0.11",
|
||||
"@nestjs/platform-express": "^9.0.11",
|
||||
|
@ -252,6 +252,7 @@ export class UserService {
|
||||
user.username = newUserInfo.username;
|
||||
user.display_name = newUserInfo.display_name;
|
||||
user.password = hashword;
|
||||
user.activity_at = new Date();
|
||||
|
||||
await this.userRepository.insert(user);
|
||||
|
||||
|
Reference in New Issue
Block a user