-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
42 lines (36 loc) · 1.2 KB
/
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
35
36
37
38
39
40
41
42
FROM oven/bun:latest
WORKDIR /usr/src/app
ARG THRESHOLD=${THRESHOLD}
ENV THRESHOLD=${THRESHOLD}
ARG NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
ENV NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
ARG NEXTAUTH_URL=${NEXTAUTH_URL}
ENV NEXTAUTH_URL=${NEXTAUTH_URL}
ARG DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID}
ENV DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID}
ARG DISCORD_CLIENT_SECRET=${DISCORD_CLIENT_SECRET}
ENV DISCORD_CLIENT_SECRET=${DISCORD_CLIENT_SECRET}
ARG TWITCH_CLIENT_ID=${TWITCH_CLIENT_ID}
ENV TWITCH_CLIENT_ID=${TWITCH_CLIENT_ID}
ARG TWITCH_CLIENT_SECRET=${TWITCH_CLIENT_SECRET}
ENV TWITCH_CLIENT_SECRET=${TWITCH_CLIENT_SECRET}
ARG DATABASE_URL=${DATABASE_URL}
ENV DATABASE_URL=${DATABASE_URL}
ARG NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL}
ENV NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL}
# Install nodejs using n
RUN apt-get -y update; apt-get -y install curl
ARG NODE_VERSION=18
RUN curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n \
&& bash n $NODE_VERSION \
&& rm n \
&& npm install -g n
COPY bun.lockb package.json prisma ./
RUN bun install
COPY . .
RUN bunx prisma generate
RUN bun run build
ENV NODE_ENV production
WORKDIR /usr/src/app/.next/standalone
EXPOSE 3000
ENTRYPOINT [ "node", "server.js" ]