This commit is contained in:
@@ -14,6 +14,14 @@ RUN apk add --no-cache tzdata
|
||||
RUN cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && echo "Asia/Tehran" > /etc/timezone
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
ARG VITE_API_URL
|
||||
ARG VITE_TOKEN_NAME=dpage-editor-t
|
||||
ARG VITE_REFRESH_TOKEN_NAME=dpage-editor-refresh-t
|
||||
ENV VITE_API_URL=$VITE_API_URL \
|
||||
VITE_TOKEN_NAME=$VITE_TOKEN_NAME \
|
||||
VITE_REFRESH_TOKEN_NAME=$VITE_REFRESH_TOKEN_NAME
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci --legacy-peer-deps
|
||||
COPY . ./
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# =====================================
|
||||
# Production Docker Compose — dpage-editor
|
||||
# =====================================
|
||||
# Vite SPA (static) served by nginx on port 80
|
||||
# Build context: repository root (parent of this file)
|
||||
# =====================================
|
||||
|
||||
services:
|
||||
|
||||
app:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
- VITE_API_URL=${VITE_API_URL}
|
||||
- VITE_TOKEN_NAME=${VITE_TOKEN_NAME:-dpage-editor-t}
|
||||
- VITE_REFRESH_TOKEN_NAME=${VITE_REFRESH_TOKEN_NAME:-dpage-editor-refresh-t}
|
||||
container_name: ${SERVICE_NAME:-dpage-editor}-${ENVIRONMENT:-prod}
|
||||
image: ${IMAGE_REPO:-ghcr.io/zmihamid/dpage-editor}:${TAG:-latest}
|
||||
ports:
|
||||
- "${APP_PORT_EXTERNAL:-8080}:80"
|
||||
restart: on-failure:3
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "test -s /usr/share/nginx/html/index.html"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "50m"
|
||||
max-file: "5"
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
name: ${NETWORK_NAME:-dpage-editor-network}
|
||||
Reference in New Issue
Block a user