Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
init-things
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
init-things
Commits
20e1326d
Commit
20e1326d
authored
Jul 14, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new
parent
2d9100fe
Pipeline
#14521
failed with stages
in 37 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
0 deletions
+59
-0
things/nest-typeorm2/Dockerfile
things/nest-typeorm2/Dockerfile
+21
-0
things/nest-typeorm2/install-npm-typeorm.sh
things/nest-typeorm2/install-npm-typeorm.sh
+3
-0
things/nest-typeorm2/src/app.module.ts
things/nest-typeorm2/src/app.module.ts
+35
-0
No files found.
things/nest-typeorm2/Dockerfile
0 → 100644
View file @
20e1326d
FROM
node:lts-bullseye-slim as base
LABEL
Author="Nanahira <nanahira@momobako.com>"
RUN
apt update
&&
apt
-y
install
python3 build-essential libpq-dev
&&
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
/var/tmp/
*
/var/log/
*
WORKDIR
/usr/src/app
COPY
./package*.json ./
FROM
base as builder
RUN
npm ci
&&
npm cache clean
--force
COPY
. ./
RUN
npm run build
FROM
base
ENV
NODE_ENV production
RUN
npm ci
&&
npm cache clean
--force
COPY
--from=builder /usr/src/app/dist ./dist
COPY
./config.example.yaml ./config.yaml
ENV
NODE_PG_FORCE_NATIVE=true
EXPOSE
3000
CMD
[ "npm", "run", "start:prod" ]
things/nest-typeorm2/install-npm-typeorm.sh
0 → 100755
View file @
20e1326d
#!/bin/bash
npm
install
--save
typeorm @nestjs/typeorm pg pg-native
things/nest-typeorm2/src/app.module.ts
0 → 100644
View file @
20e1326d
import
{
Module
}
from
'
@nestjs/common
'
;
import
{
AppController
}
from
'
./app.controller
'
;
import
{
AppService
}
from
'
./app.service
'
;
import
{
ConfigModule
,
ConfigService
}
from
'
@nestjs/config
'
;
import
{
loadConfig
}
from
'
./utility/config
'
;
import
{
TypeOrmModule
}
from
'
@nestjs/typeorm
'
;
@
Module
({
imports
:
[
ConfigModule
.
forRoot
({
load
:
[
loadConfig
],
isGlobal
:
true
,
}),
TypeOrmModule
.
forRootAsync
({
imports
:
[
ConfigModule
],
inject
:
[
ConfigService
],
useFactory
:
async
(
config
:
ConfigService
)
=>
({
type
:
'
postgres
'
,
entities
:
[],
autoLoadEntities
:
true
,
synchronize
:
!
config
.
get
(
'
DB_NO_INIT
'
),
host
:
config
.
get
(
'
DB_HOST
'
),
port
:
parseInt
(
config
.
get
(
'
DB_PORT
'
))
||
5432
,
username
:
config
.
get
(
'
DB_USER
'
),
password
:
config
.
get
(
'
DB_PASS
'
),
database
:
config
.
get
(
'
DB_NAME
'
),
supportBigNumbers
:
true
,
bigNumberStrings
:
false
,
}),
}),
],
controllers
:
[
AppController
],
providers
:
[
AppService
],
})
export
class
AppModule
{}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment