Skip to content

feat: add production Docker setup for full stack deployment - #330

Open
vmuralictr wants to merge 5 commits into
openmainframeproject:masterfrom
vmuralictr:feat/docker-production-223
Open

vmuralictr wants to merge 5 commits into
openmainframeproject:masterfrom
vmuralictr:feat/docker-production-223

Conversation

@vmuralictr

Copy link
Copy Markdown
Collaborator

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 compiled dist/
  • react-frontend/nginx.conf — proxies /sdt/ to the backend container, supports React Router via try_files fallback
  • backend/Dockerfile — bumps Node 20 → 22, switches to node index.js directly, uses --omit=dev
  • docker-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
  • .dockerignore files for both frontend and backend

Usage

cp .env.example .env
# Edit .env with your passwords
docker compose up --build

The app will be available at http://localhost.

Test plan

  • docker compose up --build completes without errors
  • Frontend loads at http://localhost
  • Package search returns results (API proxied correctly through nginx)
  • docker compose down -v cleans up correctly

@pleia2 pleia2 mentioned this pull request Jul 29, 2026
@pleia2
pleia2 self-requested a review August 4, 2026 22:24
@pleia2

pleia2 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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
@vmuralictr
vmuralictr force-pushed the feat/docker-production-223 branch from b3127c0 to 8c9fb40 Compare August 31, 2026 17:07

@pleia2 pleia2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works and looks good, just two tiny things to adjust to get to perfect 😄

Comment thread README.md
```bash
git clone --recurse-submodules https://github.com/openmainframeproject/software-discovery-tool.git
cd software-discovery-tool
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread README.md
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker based project isolation

2 participants