feat: implement pwa, add dockerfiles for web and cli, and introduce folder selection with wasm error handling.
This commit is contained in:
29
webapp/Dockerfile
Normal file
29
webapp/Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
# Build stage
|
||||
FROM node:18-slim AS build
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM nginx:stable-alpine
|
||||
# Copy the build output
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
# Custom nginx config to handle WASM and SPA routing
|
||||
RUN printf "server {\n\
|
||||
listen 80;\n\
|
||||
location / {\n\
|
||||
root /usr/share/nginx/html;\n\
|
||||
index index.html;\n\
|
||||
try_files \$uri \$uri/ /index.html;\n\
|
||||
}\n\
|
||||
location ~* \\.wasm$ {\n\
|
||||
root /usr/share/nginx/html;\n\
|
||||
default_type application/wasm;\n\
|
||||
}\n\
|
||||
}" > /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user