2021-07-29 04:43:47 +09:00
|
|
|
## Builder
|
|
|
|
FROM node:14-alpine as builder
|
|
|
|
|
|
|
|
WORKDIR /src
|
|
|
|
|
|
|
|
COPY . /src
|
|
|
|
RUN npm install \
|
|
|
|
&& npm run build
|
|
|
|
|
|
|
|
|
|
|
|
## App
|
|
|
|
FROM nginx:alpine
|
|
|
|
|
|
|
|
COPY --from=builder /src/dist /app
|
|
|
|
COPY --from=builder /src/olm.wasm /app/olm.wasm
|
2021-08-02 00:27:43 +09:00
|
|
|
COPY --from=builder /src/_redirects /app/_redirects
|
2021-07-29 04:43:47 +09:00
|
|
|
|
|
|
|
# Insert wasm type into Nginx mime.types file so they load correctly.
|
|
|
|
RUN sed -i '3i\ \ \ \ application/wasm wasm\;' /etc/nginx/mime.types
|
|
|
|
|
|
|
|
RUN rm -rf /usr/share/nginx/html \
|
|
|
|
&& ln -s /app /usr/share/nginx/html
|