{"id":19151227,"url":"https://github.com/hendrapaiton/container","last_synced_at":"2026-05-02T23:34:08.313Z","repository":{"id":121382039,"uuid":"392503875","full_name":"hendrapaiton/container","owner":"hendrapaiton","description":"Fastapi and MongoDB Container using Podman","archived":false,"fork":false,"pushed_at":"2021-08-04T19:26:24.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-22T20:47:48.485Z","etag":null,"topics":["fastapi","httpx","mongodb","podman","pytest","uvicorn"],"latest_commit_sha":null,"homepage":"","language":"Python","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/hendrapaiton.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}},"created_at":"2021-08-04T01:10:54.000Z","updated_at":"2021-08-04T19:26:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"2eed5545-2b9e-4dee-8d86-b0627157e6bf","html_url":"https://github.com/hendrapaiton/container","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hendrapaiton/container","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendrapaiton%2Fcontainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendrapaiton%2Fcontainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendrapaiton%2Fcontainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendrapaiton%2Fcontainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hendrapaiton","download_url":"https://codeload.github.com/hendrapaiton/container/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendrapaiton%2Fcontainer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259444954,"owners_count":22858548,"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":["fastapi","httpx","mongodb","podman","pytest","uvicorn"],"created_at":"2024-11-09T08:14:10.221Z","updated_at":"2025-10-22T10:52:37.582Z","avatar_url":"https://github.com/hendrapaiton.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CONTAINER MANAGEMENT USING PODMAN\n\n\n## Create FastAPI Application\nFirst, create simple application with fastapi.\n\n```python\nfrom fastapi import FastAPI\n\napp = FastAPI()\n\n\n@app.get(\"/\")\nasync def root():\n    return {\"pesan\": \"Halo Dunia\"}\n\n```\n\n## Create Containerfile for fastapi\nCreate Containerfile.\n\n```\nFROM python:3.8.5-alpine\n\nWORKDIR /app\n\nENV PYTHONDONTWRITEBYTECODE 1\nENV PYTHONUNBUFFERED 1\n\nCOPY ./requirements.txt /app/requirements.txt\n\nRUN set -eux \\\n    \u0026\u0026 apk add --no-cache --virtual .build-deps build-base libressl-dev libffi-dev gcc musl-dev python3-dev \\\n    \u0026\u0026 pip install --upgrade pip setuptools wheel \\\n    \u0026\u0026 pip install -r /app/requirements.txt \\\n    \u0026\u0026 rm -rf /root/.cache/pip\n\nCOPY . /app/\n```\n\n## Build and Deploy container using Podman\nWhen Containerfile already created, now build images of fastapi application.\n\n```bash\n$ podman build -t fastapi .\n```\n\nCheck if images successfully created.\n```bash\n$ podman images\nREPOSITORY                TAG           IMAGE ID      CREATED         SIZE\nlocalhost/fastapi         latest        b6e2a7315140  17 seconds ago  520 MB\ndocker.io/library/python  3.8.5-alpine  0f03316d4a27  10 months ago   44.7 MB\n``` \n\nAnd then deploy the image to container.\n```bash\n$ podman run -dt -p 8000:8000/tcp localhost/fastapi\n```\n\nFinally check if container already run.\n```bash\n$ podman ps -a\nCONTAINER ID  IMAGE                     COMMAND               CREATED         STATUS             PORTS                   NAMES\n3f7474cd97c5  localhost/fastapi:latest  uvicorn server.ap...  52 seconds ago  Up 51 seconds ago  0.0.0.0:8000-\u003e8000/tcp  nervous_galois\n```\n\n## Testing application in container\nTesting url of container using curl.\n```bash\n$ curl localhost:8000\n{\"pesan\": \"Halo Dunia\"}\n```\n\n---\n\n### Reference\n\n[Fastapi Tutorial](https://fastapi.tiangolo.com/tutorial/first-steps/)\n\n[Podman Container Tutorial](https://podman.io/getting-started/)\n\n[Podman Pod Tutorial](https://developers.redhat.com/blog/2019/01/15/podman-managing-containers-pods#pods_and_container_management)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhendrapaiton%2Fcontainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhendrapaiton%2Fcontainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhendrapaiton%2Fcontainer/lists"}