React + TypeScript + Vite application to browse/manage S3-compatible storage, with a production Docker image served by Nginx.
- Node.js 20+ (22 recommended)
- npm 9+
- Docker (for container build/run)
- Install dependencies:
cd S3WebClientnpm ci
- Start the dev server:
npm run dev
- Open the app:
Optional:
- Unit tests:
npm test - Type-check + build preview:
npm run build && npm run preview
From S3WebClient:
npm run build- Output is in
S3WebClient/dist/
Runtime config for a static SPA is baked at build-time. Provide variables via .env.production in S3WebClient/ before building. Only variables prefixed with VITE_ are exposed to the client.
Example S3WebClient/.env.production:
VITE_APP_NAME=S3 Web Client
VITE_API_BASE_URL=https://api.example.com
This repo includes a multi-stage Dockerfile at the repo root that builds the app and serves it with Nginx.
Build image:
docker build -t s3webclient .
Run container:
docker run --rm -p 8080:80 s3webclient- Open http://localhost:8080
Notes:
- The Docker build uses Node 22 (alpine) and
nginx:stable-alpine. - SPA routing is configured via
nginx.confwithtry_files ... /index.html. - To customize app config, add/edit
S3WebClient/.env.productionbefore building the image (see Configuration above).
This repo includes a GitHub Actions workflow to build and publish the Docker image to Docker Hub.
- Create secrets
- Preferred: Environment secrets under
Settings → Environments → Prod → Secrets. DOCKERHUB_USERNAME: your Docker Hub usernameDOCKERHUB_TOKEN: a Docker Hub access token (Account Settings → Security → New Access Token)
- Optional: adjust image name
- By default, the workflow publishes to
${DOCKERHUB_USERNAME}/s3webclient. - To change, edit
env.IMAGE_NAMEin.github/workflows/docker-publish.yml.
- Triggers
- On push to branches named
release-<version>(e.g.,release-0.0.1) orrealease-<version>. - Also via manual dispatch from the Actions tab.
- Tagging & Releases
- On
release-*branches the workflow pushes two tags:<DOCKERHUB_USERNAME>/s3webclient:<version>where<version>comes from the branch name (prefixrelease-/realease-stripped)<DOCKERHUB_USERNAME>/s3webclient:latest
- Nessun trigger su
main/master: crei la release quando apri/pushi un branchrelease-*. - Viene anche creata/aggiornata una GitHub Release con tag
<version>.
- Environment
- The workflow targets the
Prodenvironment to read its secrets and (optionally) require approvals.