-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (53 loc) · 1.79 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
FROM oven/bun:alpine as base
WORKDIR /app
## Server/Client env
ARG VITE_ENV
ENV VITE_ENV ${VITE_ENV}
ARG VITE_BASE_URL
ENV VITE_BASE_URL ${VITE_BASE_URL}
ARG VITE_BASE_API_URL
ENV VITE_BASE_API_URL ${VITE_BASE_API_URL}
ARG VITE_APP_VERSION
ENV VITE_APP_VERSION ${VITE_APP_VERSION}
ARG VITE_COOKIE_DOMAIN
ENV VITE_COOKIE_DOMAIN ${VITE_COOKIE_DOMAIN}
ARG VITE_POSTHOG_KEY
ENV VITE_POSTHOG_KEY ${VITE_POSTHOG_KEY}
ARG VITE_POSTHOG_HOST
ENV VITE_POSTHOG_HOST ${VITE_POSTHOG_HOST}
ARG VITE_FIREBASE_API_KEY
ENV VITE_FIREBASE_API_KEY ${VITE_FIREBASE_API_KEY}
ARG VITE_FIREBASE_AUTH_DOMAIN
ENV VITE_FIREBASE_AUTH_DOMAIN ${VITE_FIREBASE_AUTH_DOMAIN}
ARG VITE_FIREBASE_PROJECT_ID
ENV VITE_FIREBASE_PROJECT_ID ${VITE_FIREBASE_PROJECT_ID}
ARG VITE_FIREBASE_STORAGE_BUCKET
ENV VITE_FIREBASE_STORAGE_BUCKET ${VITE_FIREBASE_STORAGE_BUCKET}
ARG VITE_FIREBASE_MESSAGING_SENDER_ID
ENV VITE_FIREBASE_MESSAGING_SENDER_ID ${VITE_FIREBASE_MESSAGING_SENDER_ID}
ARG VITE_FIREBASE_APP_ID
ENV VITE_FIREBASE_APP_ID ${VITE_FIREBASE_APP_ID}
## Server env
ARG PORT
ENV PORT ${PORT}
ARG NODE_ENV=production
ENV NODE_ENV ${NODE_ENV}
ARG PEXELS_API_KEY
ENV PEXELS_API_KEY ${PEXELS_API_KEY}
ARG GOOGLE_APPLICATION_CREDENTIALS
ENV GOOGLE_APPLICATION_CREDENTIALS ${GOOGLE_APPLICATION_CREDENTIALS}
FROM base as builder
COPY . .
RUN bun install --frozen-lockfile
RUN NODE_OPTIONS=--max_old_space_size=8192 bun run build
FROM base as release
COPY --from=builder app/dist ./dist
COPY --from=builder app/package.json ./package.json
COPY --from=builder app/tsconfig.json ./tsconfig.json
COPY --from=builder app/locales ./locales
COPY --from=builder app/firebase ./firebase
COPY --from=builder app/server ./server
COPY --from=builder app/bun.lockb ./bun.lockb
RUN bun install --production --frozen-lockfile-dry-run
EXPOSE ${PORT}
CMD [ "bun", "run", "start" ]