2021-10-08 08:22:15 +00:00
|
|
|
FROM node:14-alpine3.14 AS builder
|
2021-10-04 03:56:00 +00:00
|
|
|
WORKDIR /build
|
2021-10-07 04:40:31 +00:00
|
|
|
|
2021-10-04 03:56:00 +00:00
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
|
|
|
|
COPY src ./src
|
|
|
|
COPY scripts ./scripts
|
|
|
|
COPY prisma ./prisma
|
2021-10-04 05:31:45 +00:00
|
|
|
COPY twilight ./twilight
|
2021-10-04 03:56:00 +00:00
|
|
|
|
2021-10-15 06:40:27 +00:00
|
|
|
COPY package.json yarn.lock next.config.js next-env.d.ts void-env.d.ts tsconfig.json .eslintrc.js server.ts ./
|
2021-10-04 03:56:00 +00:00
|
|
|
|
|
|
|
RUN yarn install
|
|
|
|
|
2021-10-07 04:40:31 +00:00
|
|
|
ENV DATABASE_URL=postgres://postgres:postgres@postgres/postgres
|
|
|
|
|
|
|
|
RUN echo -e "[core]\nsecret = 'dockersecret'\n[uploader]\nraw_route = '/r'\ndirectory = './uploads'\n[shortener]\nroute = '/go'" > config.toml
|
2021-10-04 03:56:00 +00:00
|
|
|
|
|
|
|
RUN yarn build
|
|
|
|
|
2021-10-08 08:22:15 +00:00
|
|
|
FROM node:14-alpine3.14 AS runner
|
2021-10-04 05:02:20 +00:00
|
|
|
WORKDIR /void
|
2021-10-04 03:56:00 +00:00
|
|
|
|
|
|
|
COPY --from=builder /build/node_modules ./node_modules
|
|
|
|
|
|
|
|
COPY --from=builder /build/src ./src
|
2021-10-15 06:40:27 +00:00
|
|
|
COPY --from=builder /build/server.ts ./server.ts
|
2021-10-04 03:56:00 +00:00
|
|
|
COPY --from=builder /build/scripts ./scripts
|
|
|
|
COPY --from=builder /build/prisma ./prisma
|
|
|
|
COPY --from=builder /build/.next ./.next
|
2021-10-07 04:40:31 +00:00
|
|
|
COPY --from=builder /build/.eslintrc.js ./.eslintrc.js
|
2021-10-04 03:56:00 +00:00
|
|
|
COPY --from=builder /build/tsconfig.json ./tsconfig.json
|
|
|
|
COPY --from=builder /build/package.json ./package.json
|
2021-10-04 05:31:45 +00:00
|
|
|
COPY --from=builder /build/twilight ./twilight
|
2021-10-04 03:56:00 +00:00
|
|
|
|
2021-10-06 12:12:25 +00:00
|
|
|
CMD ["yarn", "start"]
|