-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
70 lines (54 loc) · 2.08 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
FROM node:lts AS builder
# Install the dependencies needed to build Clean Slate
COPY package.json .
COPY pnpm-lock.yaml .
RUN ["npm", "install", "pnpm", "-g"]
RUN ["pnpm", "install", "--frozen-lockfile", "--prod"]
# Copy over the folders and files from /src needed to build Clean Slate
COPY src/assets src/assets
COPY src/components src/components
COPY src/constants src/constants
COPY src/graphql src/graphql
COPY src/helpers src/helpers
COPY src/hooks src/hooks
COPY src/models src/models
COPY src/pages src/pages
COPY src/public src/public
COPY src/store src/store
COPY src/basicFoods.json src/basicFoods.json
COPY src/index.d.ts src/index.d.ts
COPY src/next-env.d.ts src/next-env.d.ts
COPY src/next.config.js src/next.config.js
COPY src/storeon.ts src/storeon.ts
COPY src/theme.scss src/theme.scss
COPY src/theme.ts src/theme.ts
COPY src/tsconfig.json src/tsconfig.json
COPY src/workbox-config.js src/workbox-config.js
# Build Clean Slate
# Define the ARG and ENV
ARG NEXT_PUBLIC_FIREBASE_CONFIG='{}'
ARG NEXT_PUBLIC_LEGAL_LINK="no"
ARG NEXT_PUBLIC_LOGIN_WITH_APPLE="no"
ARG NEXT_PUBLIC_LOGIN_WITH_FACEBOOK="no"
ARG NEXT_PUBLIC_LOGIN_WITH_GITHUB="no"
ARG NEXT_PUBLIC_LOGIN_WITH_GOOGLE="no"
ARG NEXT_PUBLIC_REACT_SENTRY_DSN="no"
ARG NEXT_PUBLIC_USE_FIREBASE="false"
ARG NEXT_PUBLIC_VERSION
ENV NEXT_PUBLIC_FIREBASE_CONFIG=$NEXT_PUBLIC_FIREBASE_CONFIG
ENV NEXT_PUBLIC_LEGAL_LINK=$NEXT_PUBLIC_LEGAL_LINK
ENV NEXT_PUBLIC_LOGIN_WITH_APPLE=$NEXT_PUBLIC_LOGIN_WITH_APPLE
ENV NEXT_PUBLIC_LOGIN_WITH_FACEBOOK=$NEXT_PUBLIC_LOGIN_WITH_FACEBOOK
ENV NEXT_PUBLIC_LOGIN_WITH_GITHUB=$NEXT_PUBLIC_LOGIN_WITH_GITHUB
ENV NEXT_PUBLIC_LOGIN_WITH_GOOGLE=$NEXT_PUBLIC_LOGIN_WITH_GOOGLE
ENV NEXT_PUBLIC_REACT_SENTRY_DSN=$NEXT_PUBLIC_REACT_SENTRY_DSN
ENV NEXT_PUBLIC_USE_FIREBASE=$NEXT_PUBLIC_USE_FIREBASE
ENV NEXT_PUBLIC_VERSION=$NEXT_PUBLIC_VERSION
# Build the static files of Clean Slate
COPY build.sh .
RUN ["bash", "-e", "build.sh"]
FROM busybox:latest AS runner
# Copy over the built version of Clean Slate
COPY --from=builder out out
# Serve Clean Slate with busybox
CMD ["busybox", "httpd", "-f", "-v", "-p", "3000", "-h", "out"]