{"id":43857090,"url":"https://github.com/zopdev/static-server","last_synced_at":"2026-02-06T09:28:24.135Z","repository":{"id":265099425,"uuid":"876771773","full_name":"zopdev/static-server","owner":"zopdev","description":"A server written in golang using gofr framework which can serve static files. ","archived":false,"fork":false,"pushed_at":"2025-02-19T09:51:55.000Z","size":57,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-19T10:32:18.145Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zopdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-22T14:28:52.000Z","updated_at":"2025-02-19T09:50:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"297d675a-4fc0-4e37-b877-6879b46cf53b","html_url":"https://github.com/zopdev/static-server","commit_stats":null,"previous_names":["zopdev/static-server"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/zopdev/static-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopdev%2Fstatic-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopdev%2Fstatic-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopdev%2Fstatic-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopdev%2Fstatic-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zopdev","download_url":"https://codeload.github.com/zopdev/static-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopdev%2Fstatic-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29156903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T07:18:23.844Z","status":"ssl_error","status_checked_at":"2026-02-06T07:13:32.659Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-02-06T09:28:21.307Z","updated_at":"2026-02-06T09:28:24.130Z","avatar_url":"https://github.com/zopdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Static Server\n\nA simple and efficient solution for serving static files.\n\n## Features\n\n- **Easy to use**: Just place your static files in the `static` directory, and the server takes care of the rest.\n- **Dockerized**: Easily deployable as a Docker container.\n- **Lightweight**: Minimal dependencies for optimal performance.\n- **Configurable**: You can easily configure the server or extend it based on your needs.\n  - The server serves files from the `static` directory by default, but you can change this by setting the `STATIC_DIR_PATH` environment variable.\n  - Support all the confgs of the gofr framework - https://gofr.dev\n\n## Usage\n\n### 1. Build a Docker image\n\nTo deploy the server, you need to build a Docker image using the provided `Dockerfile`.\n\n#### Example `Dockerfile`\n\n```dockerfile\n# Use the official static-server image as the base image\n# This will pull the latest prebuilt version of the static-server to run your static website\nFROM zopdev/static-server:latest\n\n# Copy static files into the container\n# The 'COPY' directive moves your static files (in this case, located at '/app/out') into the '/website' directory\n# which is where the static server expects to find the files to serve\nCOPY /app/out /static\n\n# Expose the port on which the server will run\n# By default, the server listens on port 8000, so we expose that port to allow access from outside the container\nEXPOSE 8000\n\n# Define the command to run the server\n# The static server is started with the '/main' binary included in the image, which will start serving\n# the files from the '/website' directory on port 8000\nCMD [\"/main\"]\n```\n\n### 2. Build the Docker image\n\nNavigate to your project directory and run the following command to build the Docker image:\n\n```bash\ndocker build -t static-server .\n```\n\nThis command:\n- Uses the `Dockerfile` in the current directory (`.`) to build an image.\n- Tags the image with the name `static-server` (`-t static-server`).\n\n### 3. Run the Docker container\n\nOnce the image is built, run the container using the following command:\n\n```bash\ndocker run -d -p 8000:8000 static-server\n```\n\nThis command:\n- Runs the container in detached mode (`-d`).\n- Maps port 8000 on your host machine to port 8000 inside the container (`-p 8000:8000`), so you can access the static files via `http://localhost:8000`.\n\n### 4. Access your static website\n\nOnce the container is running, you can visit your website at:\n\n```\nhttp://localhost:8000\n```\n\nYour static files will be served, and the root (`/`) will typically display your `index.html` (if present).\n\n## Notes\n\n- The server serves all files in the `website` directory, so make sure to avoid any sensitive files or configuration details in that directory.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzopdev%2Fstatic-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzopdev%2Fstatic-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzopdev%2Fstatic-server/lists"}