add docker-compose
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
hamid zarghami
2026-05-26 11:28:10 +03:30
parent 96647786e8
commit 112cc1c4dc
2 changed files with 48 additions and 0 deletions
+8
View File
@@ -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 . ./
+40
View File
@@ -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}