Skip to content

Commit 39ebe8e

Browse files
committed
chore: make dockerfile prettier
1 parent 77d2299 commit 39ebe8e

File tree

4 files changed

+42
-10
lines changed

4 files changed

+42
-10
lines changed

Dockerfile

+36-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,43 @@
1-
FROM node:20-alpine3.18 AS base
1+
FROM node:20-alpine AS builder
22

3-
WORKDIR /app
3+
WORKDIR /sources
44

55
COPY package.json yarn.lock ./
66

7-
RUN yarn install --frozen-lockfile \
8-
&& yarn cache clean
7+
RUN yarn install --frozen-lockfile
98

109
COPY . .
1110

12-
ENTRYPOINT ["yarn", "start"]
11+
RUN npm run build
12+
13+
FROM node:20-alpine AS staging
14+
15+
WORKDIR /app
16+
17+
COPY --from=builder /sources/package.json /sources/yarn.lock ./
18+
COPY --from=builder /sources/tsconfig.json /sources/tsconfig.build.json ./
19+
COPY --from=builder /sources/dist ./dist
20+
21+
ENV NODE_ENV=development
22+
23+
RUN yarn install --frozen-lockfile
24+
25+
EXPOSE 8080
26+
27+
CMD ["node", "./dist/main.js"]
28+
29+
FROM node:20-alpine AS production
30+
31+
WORKDIR /app
32+
33+
COPY --from=builder /sources/package.json /sources/yarn.lock ./
34+
COPY --from=builder /sources/tsconfig.json /sources/tsconfig.build.json ./
35+
COPY --from=builder /sources/dist ./dist
36+
37+
ENV NODE_ENV=production
38+
39+
RUN yarn install --frozen-lockfile --production
40+
41+
EXPOSE 8080
42+
43+
CMD ["node", "./dist/main.js"]

docker-compose.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ services:
77
image: 'ghcr.io/necordjs/toolkit:latest'
88
environment:
99
DISCORD_TOKEN: 'your-token'
10+
SENTRY_DSN: 'your-dsn'

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"Alexey Filippov <[email protected]>"
3636
],
3737
"dependencies": {
38-
"@necord/pagination": "1.3.1",
38+
"@necord/pagination": "2.0.4",
3939
"@nestjs/axios": "4.0.0",
4040
"@nestjs/common": "10.4.15",
4141
"@nestjs/config": "4.0.1",

yarn.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)