feat: add Docker and Docker Compose support for all services#47
Open
PranavGadge01 wants to merge 1 commit intoc2siorg:mainfrom
Open
feat: add Docker and Docker Compose support for all services#47PranavGadge01 wants to merge 1 commit intoc2siorg:mainfrom
PranavGadge01 wants to merge 1 commit intoc2siorg:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds full Docker and Docker Compose support across all three LensMint
services, enabling any contributor to spin up the entire stack locally
with a single command — no manual Node.js setup, no dependency conflicts,
no environment guesswork.
Motivation
Currently, setting up LensMint locally requires:
This PR removes all of that friction and makes the project significantly
more accessible to new contributors and GSoC applicants.
Changes
Owner Portal (
owner-portal/)Dockerfile— multi-stage build: Node.js 18 Alpine for building theVite app, then nginx Alpine to serve the static output. Keeps the final
image small and production-appropriate.
nginx.conf— configures nginx to support React client-side routing(all routes fall back to index.html) with static asset caching.
.dockerignore— excludes node_modules, dist, .env files and logs.Public Server (
lensmint-public-server/)Dockerfile— Node.js 18 Alpine, installs production dependencies only,creates the database directory, exposes port 4000.
.dockerignore— excludes node_modules, database files and .env.Hardware Web3 Service (
hardware-web3-service/)Dockerfile— Node.js 18 Alpine, installs production dependencies only,creates the database directory, exposes port 5000.
.dockerignore— excludes node_modules, database files and .env.Root Level
docker-compose.yml— orchestrates all three services on a sharedbridge network (
lensmint-network). Database files are persisted vianamed Docker volumes so data survives container restarts. All secrets
and config are passed via environment variables at runtime — nothing
baked into the image.
.env.example— single root-level template covering every environmentvariable needed across all three services, with clear comments.
Architecture
Usage
Design Decisions
Node.js image to compile the Vite app. The final stage uses nginx Alpine
(~25MB) instead of Node (~150MB), keeping the image lean.
npm install --productionto exclude devDependencies from the image.named Docker volumes, not bind mounts, so they persist across
docker compose downand work cross-platform without permission issues.injected at runtime via environment variables. The .env file is excluded
from all images via .dockerignore.
lensmint-networkrather than exposing inter-service calls through the host.
Testing
docker compose buildcompletes without errorsdocker compose updocker compose downanddocker compose up