-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
35 lines (27 loc) · 857 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM --platform=$BUILDPLATFORM node:20 AS base
WORKDIR /app
COPY package.json package.json
COPY pnpm-lock.yaml pnpm-lock.yaml
RUN npm i -g pnpm
FROM base AS prod-deps
RUN pnpm install --production --frozen-lockfile
FROM base AS dev-deps
RUN pnpm install --frozen-lockfile
FROM dev-deps AS build
COPY . .
ENV NODE_ENV=production
ENV DATABASE_URL=file:./database.sqlite
ENV TELEGRAM_API_ID=0
ENV TELEGRAM_API_HASH=0
RUN pnpm drizzle-kit push:sqlite
RUN pnpm run build
FROM --platform=$BUILDPLATFORM node:18-alpine AS runtime
COPY --from=build /app/.next .next
COPY --from=build /app/public public
COPY --from=build /app/package.json package.json
COPY --from=prod-deps /app/node_modules node_modules
COPY --from=build /app/database.sqlite database.sqlite
ENV NODE_ENV=production
ENV DATABASE_URL=file:./database.sqlite
EXPOSE 3000
CMD ["npm", "start"]