{"id":25897060,"url":"https://github.com/sharif-minhaz/dockerize-fullstack-app-example","last_synced_at":"2026-05-05T04:09:26.941Z","repository":{"id":279545677,"uuid":"939156561","full_name":"Sharif-Minhaz/dockerize-fullstack-app-example","owner":"Sharif-Minhaz","description":"This repo walks you through setting up and running a Dockerized React frontend and Node.js backend, both for development and production. You'll find Dockerfiles, Docker Compose configs, and all the key commands to build, run, and manage your containers with ease.","archived":false,"fork":false,"pushed_at":"2025-02-26T05:10:51.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T06:20:12.078Z","etag":null,"topics":["docker","docker-compose","docker-container","docker-hub","docker-image","full-stack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sharif-Minhaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-26T04:44:40.000Z","updated_at":"2025-02-26T05:14:36.000Z","dependencies_parsed_at":"2025-02-26T06:20:20.760Z","dependency_job_id":null,"html_url":"https://github.com/Sharif-Minhaz/dockerize-fullstack-app-example","commit_stats":null,"previous_names":["sharif-minhaz/dockerize-fullstack-app-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sharif-Minhaz/dockerize-fullstack-app-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sharif-Minhaz%2Fdockerize-fullstack-app-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sharif-Minhaz%2Fdockerize-fullstack-app-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sharif-Minhaz%2Fdockerize-fullstack-app-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sharif-Minhaz%2Fdockerize-fullstack-app-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sharif-Minhaz","download_url":"https://codeload.github.com/Sharif-Minhaz/dockerize-fullstack-app-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sharif-Minhaz%2Fdockerize-fullstack-app-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265436798,"owners_count":23765034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","docker-container","docker-hub","docker-image","full-stack"],"created_at":"2025-03-02T23:17:44.315Z","updated_at":"2025-09-19T11:27:16.931Z","avatar_url":"https://github.com/Sharif-Minhaz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Setup Guide\n\n## **Docker Compose for Production**\n\n```yaml\nversion: \"3.8\"\n\nservices:\n    backend:\n        image: minhaz3001/user_server:v0.0.1\n        container_name: user_server\n        ports:\n            - 8080:8080\n        environment:\n            - NODE_ENV=production\n            - SERVER_KEY=12345000000\n\n    frontend:\n        image: minhaz3001/user_client:latest\n        container_name: user_client\n        ports:\n            - 80:80\n        depends_on:\n            - backend\n```\n\n### **Starting the Production Containers**\n\n```bash\ndocker-compose up -d\n```\n\nTo check logs:\n\n```bash\ndocker-compose logs -f\n```\n\nTo stop and remove containers:\n\n```bash\ndocker-compose down\n```\n\n## **Docker Compose for Development**\n\n```yaml\nversion: \"3.8\"\n\nservices:\n    frontend:\n        build:\n            context: ./client\n            args:\n                - VITE_API_URL=${VITE_API_URL}\n                - VITE_CLIENT_SECRET=${VITE_CLIENT_SECRET}\n        container_name: user_client\n        ports:\n            - 5173:5173\n        volumes:\n            - ./client/:/app\n            - /app/node_modules\n        env_file:\n            - client/.env\n\n    backend:\n        build: ./server\n        container_name: user_server\n        ports:\n            - 8080:8080\n        volumes:\n            - ./server/:/app\n            - /app/node_modules\n        env_file:\n            - server/.env\n```\n\n### **Starting the Development Containers**\n\n```bash\ndocker-compose up -d\n```\n\n## **Dockerfile for Client Development**\n\n```dockerfile\nFROM node\nWORKDIR /app\nCOPY package*.json ./\nRUN npm i\nCOPY . .\nEXPOSE 5173\nCMD [\"npm\", \"run\", \"dev\"]\n```\n\n## **Dockerfile for Client Production**\n\n```dockerfile\n# Build Stage\nFROM node:18 AS builder\nWORKDIR /app\nCOPY package*.json ./\nRUN npm install\nCOPY . .\n\n# Pass environment variables during build\nARG VITE_API_URL\nARG VITE_CLIENT_SECRET\nENV VITE_API_URL=$VITE_API_URL\nENV VITE_CLIENT_SECRET=$VITE_CLIENT_SECRET\n\nRUN npm run build\n\n# Serve static files using Nginx\nFROM nginx:alpine\nCOPY --from=builder /app/dist /usr/share/nginx/html\nEXPOSE 80\nCMD [\"nginx\", \"-g\", \"daemon off;\"]\n```\n\n## **Dockerfile for Server Development**\n\n```dockerfile\nFROM node\nWORKDIR /app\nCOPY package*.json ./\nRUN npm i --omit=dev\nCOPY . .\nEXPOSE 8080\nCMD [\"npm\", \"run\", \"dev\"]\n```\n\n## **Dockerfile for Server Production**\n\n```dockerfile\nFROM node:18\nWORKDIR /app\nCOPY package*.json ./\nRUN npm install --omit=dev\nCOPY . .\nEXPOSE 8080\nCMD [\"node\", \"index.js\"]\n```\n\n## **Building Docker Images**\n\n### **Client Production Build**\n\n```bash\ndocker build -t minhaz3001/user_client -f client/Dockerfile client\n```\n\n### **Server Production Build**\n\n```bash\ndocker build -t minhaz3001/user_server -f server/Dockerfile server\n```\n\n### **Client Development Build**\n\n```bash\ndocker build -t minhaz3001/user_client -f client/Dockerfile client\n```\n\n### **Server Development Build**\n\n```bash\ndocker build -t minhaz3001/user_server -f server/Dockerfile server\n```\n\n## **Running Development Containers Individually**\n\n### **Client Development Container**\n\n```bash\ndocker run -d --name user_client \\\n  -p 5173:5173 \\\n  -v $(pwd)/client:/app \\\n  -v /app/node_modules \\\n  minhaz3001/user_client\n```\n\n### **Server Development Container**\n\n```bash\ndocker run -d --name user_server \\\n  -p 8080:8080 \\\n  -v $(pwd)/server:/app \\\n  -v /app/node_modules \\\n  --env-file $(pwd)/server/.env \\\n  minhaz3001/user_server\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharif-minhaz%2Fdockerize-fullstack-app-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharif-minhaz%2Fdockerize-fullstack-app-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharif-minhaz%2Fdockerize-fullstack-app-example/lists"}