-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (29 loc) · 912 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#### DEPENDENCIES
FROM node:current-alpine as deps
WORKDIR /app
COPY prisma .
COPY package.json .
RUN yarn --frozen-lockfile
#### BUILDER
FROM node:current-alpine as builder
WORKDIR /app
ARG DATABASE_URL=file:/app/data/db.sqlite
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN yarn build
RUN yarn db:push --accept-data-loss
#### RUNNER
FROM node:current-alpine as runner
WORKDIR /app
ENV NODE_ENV production
COPY --from=builder /app/next.config.js .
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/.next/standalone .
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/data/db.sqlite ./data/db.sqlite
#### OPTIONS
EXPOSE 3000
ENV DATABASE_URL=${DATABASE_URL}
LABEL org.opencontainers.image.source=https://github.com/cabaalexander/pokemon-gym-tracker
CMD ["node", "server.js"]