File tree Expand file tree Collapse file tree 4 files changed +46
-10
lines changed Expand file tree Collapse file tree 4 files changed +46
-10
lines changed Original file line number Diff line number Diff line change
1
+ # Ignore all files in the node_modules directory
2
+ node_modules /
3
+
4
+ # Ignore the .git directory and all files in it
5
+ .git /
6
+
7
+ # Ignore all files in the dist directory
8
+ dist /
9
+
10
+ # Ignore all files with the .log or .md extension
11
+ * .log
12
+ * .md
Original file line number Diff line number Diff line change 1
- FROM node:18 -alpine
1
+ FROM node:20 -alpine AS builder
2
2
3
- RUN npm install -g npm@9.8.1
4
- RUN npm i -g pnpm
5
3
WORKDIR /app
4
+ RUN npm i -g pnpm
5
+
6
+ COPY package.json ./
7
+ COPY pnpm-lock.yaml ./
8
+
9
+ RUN pnpm install
10
+ RUN pnpm add express
11
+
12
+ COPY . .
13
+ COPY .production.env ./
6
14
7
- COPY ./package.json /app
8
- COPY ./pnpm-lock.yaml /app
9
- RUN pnpm i --frozen-lockfile
10
15
11
- # TODO: add db migrate command
16
+ RUN pnpm run build
17
+
18
+ FROM node:20-alpine AS runner
19
+
20
+ WORKDIR /app
21
+ COPY --from=builder --chown=node:node /app/dist ./dist
22
+ COPY --from=builder --chown=node:node /app/node_modules ./node_modules
23
+ COPY --from=builder --chown=node:node /app/.production.env ./.production.env
24
+
25
+ ENV NODE_ENV=production
26
+ USER node
12
27
13
- COPY . /app
14
- RUN pnpm run build
28
+ CMD ["node" , "dist/main.js" ]
Original file line number Diff line number Diff line change 1
1
services :
2
+ app :
3
+ container_name : korrk_backend
4
+ restart : always
5
+ build : .
6
+ ports :
7
+ - ' ${PORT}:${PORT}'
8
+ depends_on :
9
+ postgres :
10
+ condition : service_healthy
11
+
2
12
postgres :
3
13
image : postgres
4
14
container_name : postgres
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import { UtilModule } from './util/util.module';
25
25
envFilePath : `${ __dirname } /../.${ getNodeEnv } .env` ,
26
26
cache : true ,
27
27
validate : envValidation ,
28
- ignoreEnvFile : isIgnoreEnvFile ,
28
+ // ignoreEnvFile: isIgnoreEnvFile,
29
29
} ) ,
30
30
MikroOrmModule . forRoot ( ) ,
31
31
AuthModule ,
You can’t perform that action at this time.
0 commit comments