feat: add production Docker setup for full stack deployment - #330
vmuralictr wants to merge 5 commits into
Conversation
|
I haven't had a chance to go through this fully, but since we're using Apache in our production recommendations, perhaps we should use it here as well instead of Nginx so we don't need to maintain two separate webserver configurations? |
…penmainframeproject#223) - Add react-frontend/Dockerfile: multi-stage build (Node 22 builder + nginx:alpine to serve dist/) - Add react-frontend/nginx.conf: proxies /sdt/ to backend, supports React Router via try_files fallback - Update backend/Dockerfile: bump Node 20 -> 22, use node index.js directly, switch to --omit=dev - Add docker-compose.yml: wires frontend + backend + MariaDB 11 with health check dependency ordering - Add .env.example at repo root for docker-compose secrets - Add .dockerignore for both frontend and backend
- backend: fix build context to repo root so bin/, distro_data/, config/ are accessible - backend: copy bin/ and distro_data/ into image for database_build.js to work - docker-compose: remove backend port 5000 host mapping (nginx handles routing) - docker-compose: set backend build context to repo root with explicit dockerfile path - frontend: switch npm ci to npm install --legacy-peer-deps to fix peer dep errors - frontend: add VITE_REACT_APP_API_URL build arg so API calls go through nginx proxy
b3127c0 to
8c9fb40
Compare
pleia2
left a comment
There was a problem hiding this comment.
Works and looks good, just two tiny things to adjust to get to perfect 😄
| ```bash | ||
| git clone --recurse-submodules https://github.com/openmainframeproject/software-discovery-tool.git | ||
| cd software-discovery-tool | ||
| ``` |
There was a problem hiding this comment.
We want to pull the latest from the data submodule, so let's also add:
cd distro_data/data_files
git pull https://github.com/openmainframeproject/software-discovery-tool-data.git
| The quickest way to run the full stack locally is with Docker. | ||
|
|
||
| ### Prerequisites | ||
| - [Docker Desktop](https://www.docker.com/products/docker-desktop) (Mac/Windows) or Docker Engine + Docker Compose plugin (Linux) |
There was a problem hiding this comment.
For the Linux side, we need to specify: Docker Compose plugin version 2 or above
(Some distros ship with older versions, some have both, but before version 2 docker compose was quite different!).
Summary
Closes #223
Adds a complete production-ready Docker setup for the full stack:
react-frontend/Dockerfile— multi-stage build: Node 22 builds the Vite app, nginx:alpine serves the compileddist/react-frontend/nginx.conf— proxies/sdt/to the backend container, supports React Router viatry_filesfallbackbackend/Dockerfile— bumps Node 20 → 22, switches tonode index.jsdirectly, uses--omit=devdocker-compose.yml— wires frontend + backend + MariaDB 11 with health check dependency ordering so backend waits for DB to be ready.env.example(repo root) — documents the secrets needed for docker-compose.dockerignorefiles for both frontend and backendUsage
cp .env.example .env # Edit .env with your passwords docker compose up --buildThe app will be available at
http://localhost.Test plan
docker compose up --buildcompletes without errorshttp://localhostdocker compose down -vcleans up correctly