File tree 3 files changed +39
-26
lines changed
3 files changed +39
-26
lines changed Original file line number Diff line number Diff line change @@ -4,4 +4,6 @@ node_modules
4
4
npm-debug.log
5
5
README.md
6
6
.git
7
- .env
7
+ .env
8
+ dist
9
+ docker-compose.yaml
Original file line number Diff line number Diff line change 1
- FROM node:18-alpine
2
- WORKDIR /
1
+ FROM node:18-slim AS base
2
+ ENV PNPM_HOME="/pnpm"
3
+ ENV PATH="$PNPM_HOME:$PATH"
4
+ # Hook into pnpm without installing pnpm. (magic) (https://nodejs.org/docs/latest-v18.x/api/corepack.html)
5
+ RUN corepack enable
6
+ WORKDIR /usr/src/app
7
+ COPY package*.json pnpm-lock*.yaml ./
3
8
4
- COPY package*.json pnpm-lock.yaml* ./
5
- RUN npm i -g pnpm
6
9
7
- RUN pnpm install
10
+ # Create node_modules files without dev dependencies.
11
+ FROM base AS prod_dependencies
12
+ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
8
13
14
+ # Create dist.
15
+ FROM base AS builder
9
16
COPY . .
10
-
17
+ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
11
18
RUN pnpm run build
12
19
13
- CMD pnpm run start
20
+ # Final image
21
+ FROM base
22
+ ENV NODE_ENV production
23
+ WORKDIR /usr/src/app
24
+ COPY --from=prod_dependencies /usr/src/app/node_modules ./node_modules
25
+ COPY --from=builder /usr/src/app/dist ./dist
26
+ CMD [ "pnpm" , "run" , "start" ]
Original file line number Diff line number Diff line change 1
- version : " 3.3"
2
-
1
+ version : " 3.9"
3
2
services :
4
- website :
5
- container_name : " bot"
6
- image : dominikdoesdev/wy-bot
7
- environment :
8
- - TZ=Europe/Berlin
9
- - TEST_GUILD_ID=
10
- - STATUS=DEVELOPMENT
11
- - BOTSTATUS=Would You?
12
- - TOKEN=
13
- - ENCRYPTION_KEY=
14
- - TOPGG_TOKEN=
15
- - TOPGG_WEBHOOK=
16
- - SENTRY_DSN=
17
- - MONGO_URI=
18
- - LOG_PRIVATE=
19
- - LOG_GUILDS=
3
+ wouldyou-bot :
4
+ container_name : bot
5
+ build :
6
+ context : .
7
+ dockerfile : dockerfile
8
+ restart : unless-stopped
9
+ env_file :
10
+ - .env
11
+ networks :
12
+ - node
13
+ labels :
14
+ gg.wouldyou.compose-author : " Discord username 536b656c6c79 "
15
+ networks :
16
+ node :
17
+ driver : bridge
You can’t perform that action at this time.
0 commit comments