mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-10-24 03:58:05 +09:00
Move the backend into docker-compose and switch the frontend to a multi-stage Docker build. Key changes: - Added backend/.dockerignore to ignore virtualenv, pycache, env files, instance, etc. - Updated backend Flask app to safely serve index.html only if it exists and return JSON status/errors when frontend assets are absent. - Removed docker-compose.dev.yml and expanded docker-compose.yml to run both backend and frontend in Docker (backend service, healthcheck, restart/logging, new ports 5849:5000 & 3847:80, and named volumes). - Frontend changes: remove file ignores that prevented in-container builds, replace nginx-only image with a Node builder stage + nginx runtime (builds assets in Docker), and update nginx proxy to target the backend service (proxy_pass http://backend:5000). - Updated dev script (scripts/dev/dev.bat) to use plain `docker compose` commands and the new service/container names and ports. These changes enable fully containerized local/dev runs where the frontend is built inside Docker and the backend runs as a service in the compose network.
58 lines
1006 B
Batchfile
58 lines
1006 B
Batchfile
@echo off
|
|
REM ServerKit Docker Dev Helper
|
|
REM Usage: scripts\dev\dev.bat [command]
|
|
|
|
REM Get project root (two levels up from this script)
|
|
set "SCRIPT_DIR=%~dp0"
|
|
set "PROJECT_ROOT=%SCRIPT_DIR%..\.."
|
|
pushd "%PROJECT_ROOT%"
|
|
|
|
if "%1"=="" goto help
|
|
if "%1"=="up" goto up
|
|
if "%1"=="down" goto down
|
|
if "%1"=="logs" goto logs
|
|
if "%1"=="shell" goto shell
|
|
if "%1"=="reset" goto reset
|
|
goto help
|
|
|
|
:up
|
|
echo Starting ServerKit (Docker)...
|
|
docker compose up --build -d
|
|
echo.
|
|
echo Frontend: http://localhost:3847
|
|
echo Backend: http://localhost:5849
|
|
echo.
|
|
goto end
|
|
|
|
:down
|
|
docker compose down
|
|
goto end
|
|
|
|
:logs
|
|
docker compose logs -f
|
|
goto end
|
|
|
|
:shell
|
|
docker exec -it serverkit-backend /bin/bash
|
|
goto end
|
|
|
|
:reset
|
|
docker compose down -v
|
|
echo Run 'dev.bat up' to start fresh.
|
|
goto end
|
|
|
|
:help
|
|
echo.
|
|
echo Usage: scripts\dev\dev.bat [command]
|
|
echo.
|
|
echo up Start containers
|
|
echo down Stop containers
|
|
echo logs View logs
|
|
echo shell Shell into backend
|
|
echo reset Reset all data
|
|
echo.
|
|
goto end
|
|
|
|
:end
|
|
popd
|