document deployment
This commit is contained in:
35
Dockerfile.frontend
Normal file
35
Dockerfile.frontend
Normal file
@ -0,0 +1,35 @@
|
||||
# Frontend-only (IndexedDB) Dockerfile
|
||||
FROM node:18-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Clone the repository
|
||||
RUN apk add --no-cache git
|
||||
RUN git clone https://git.raphaelforment.fr/BuboBubo/palace.git .
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Build the frontend
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy built files
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
# Copy nginx config for SPA
|
||||
RUN echo 'server { \
|
||||
listen 80; \
|
||||
server_name _; \
|
||||
location / { \
|
||||
root /usr/share/nginx/html; \
|
||||
index index.html; \
|
||||
try_files $uri $uri/ /index.html; \
|
||||
} \
|
||||
}' > /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user