-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
51 lines (41 loc) · 1.64 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
ARG BASE_IMAGE=node:18-alpine3.18
FROM --platform=$BUILDPLATFORM $BASE_IMAGE AS playground-builder
WORKDIR /app
COPY ./package.json .
COPY ./yarn.lock .
COPY ./playground-ui ./playground-ui
COPY ./spicedb-common ./spicedb-common
COPY ./playground/package.json ./playground/package.json
ENV YARN_CACHE_FOLDER=/tmp/yarn_cache
RUN yarn install --frozen-lockfile --production --non-interactive --network-timeout 1000000
COPY ./playground ./playground
WORKDIR /app/playground
ARG APPLICATION_ROOT=/
ARG NODE_OPTIONS=--openssl-legacy-provider
ENV PUBLIC_URL ${APPLICATION_ROOT}
RUN yarn build
FROM $BASE_IMAGE AS playground-verifier
RUN npm install -g jshint
COPY ./playground/contrib/generate-config-env.sh .
COPY ./playground/contrib/test-config-env.sh .
RUN ./test-config-env.sh
RUN echo 'Config Verified' > verified
FROM nginx:1.25.2
LABEL maintainer="AuthZed <[email protected]>"
EXPOSE 3000
ENV PORT=3000
ENTRYPOINT ["./docker-entrypoint-wrapper.sh"]
CMD []
COPY ./playground/contrib/generate-config-env.sh .
COPY ./playground/contrib/test-nginx-conf.sh .
COPY ./playground/contrib/test-config-env.sh .
COPY ./playground/contrib/nginx.conf.tmpl .
COPY ./playground/contrib/docker-entrypoint-wrapper.sh .
RUN bash ./test-nginx-conf.sh
COPY --from=playground-verifier verified .
COPY --from=playground-builder /app/playground/build/ /usr/share/nginx/html/
COPY wasm/main.wasm /usr/share/nginx/html/static/main.wasm
COPY wasm/zed.wasm /usr/share/nginx/html/static/zed.wasm
RUN mkdir /usr/share/nginx/html/static/schemas
COPY examples/schemas/ /usr/share/nginx/html/static/schemas
RUN ls /usr/share/nginx/html/static/schemas > /usr/share/nginx/html/static/schemas/_all