Update docker compose for frontend
This commit is contained in:
7
web/.dockerignore
Normal file
7
web/.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
||||
node_modules
|
||||
dist
|
||||
.git
|
||||
.gitignore
|
||||
*.md
|
||||
.env
|
||||
.env.*
|
||||
24
web/Dockerfile
Normal file
24
web/Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
# Build stage
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
ARG VITE_API_BASE_URL=http://localhost:8100/api
|
||||
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
|
||||
RUN npm run build
|
||||
|
||||
# Serve stage (no nginx – Node + serve on port 6000)
|
||||
FROM node:20-alpine
|
||||
|
||||
RUN npm install -g serve
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/dist ./dist
|
||||
|
||||
EXPOSE 6000
|
||||
|
||||
CMD ["serve", "-s", "dist", "-l", "6000"]
|
||||
@@ -1,4 +1,4 @@
|
||||
const DEFAULT_API_BASE_URL = 'http://localhost:8000/api';
|
||||
const DEFAULT_API_BASE_URL = 'http://localhost:8100/api';
|
||||
|
||||
const trimTrailingSlash = (value: string): string => value.replace(/\/+$/, '');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user