Add Docker support with runtime environment variable configuration
- Remove temporary arne.js file - Add runtime configuration via window.__RUNTIME_CONFIG__ - Create public/config.template.js for hostname injection - Add Dockerfile with multi-stage build (node + nginx) - Add docker-entrypoint.sh to generate config.js at startup - Add .dockerignore - Update all components to use runtime config instead of arne.js - Update index.html to load config.js before app This allows deploying the same Docker image to different environments by setting the API_HOSTNAME environment variable at runtime. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
# Build stage
|
||||
FROM node:18-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Runtime stage
|
||||
FROM nginx:alpine
|
||||
RUN apk add --no-cache gettext
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
COPY public/config.template.js /usr/share/nginx/html/
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user