Dockerfile
This commit is contained in:
parent
91d9c916e2
commit
c8bc9bba07
|
|
@ -0,0 +1,31 @@
|
||||||
|
FROM node:20-alpine AS build
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install deps first
|
||||||
|
COPY package.json package-lock.json* yarn.lock* ./
|
||||||
|
RUN if [ -f package-lock.json ]; then npm ci; \
|
||||||
|
elif [ -f yarn.lock ]; then yarn install --frozen-lockfile; \
|
||||||
|
else npm install; fi
|
||||||
|
|
||||||
|
# Copy sources
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Build-time env vars for Vite
|
||||||
|
ARG VITE_SENTRY_DSN
|
||||||
|
ARG VITE_API_BASE_URL
|
||||||
|
ARG VITE_API_BASE_STORAGE_URL
|
||||||
|
ENV VITE_SENTRY_DSN=${VITE_SENTRY_DSN}
|
||||||
|
ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
|
||||||
|
ENV VITE_API_BASE_STORAGE_URL=${VITE_API_BASE_STORAGE_URL}
|
||||||
|
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM nginx:alpine AS runtime
|
||||||
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
|
||||||
|
# Minimal SPA-friendly Nginx config
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
# Increase limits for large uploads if needed
|
||||||
|
client_max_body_size 10G;
|
||||||
|
client_body_timeout 300s;
|
||||||
|
client_header_timeout 300s;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri /index.html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue