{"id":26469779,"url":"https://github.com/ocdbytes/webapp_backend_dockerised","last_synced_at":"2025-03-19T17:09:21.004Z","repository":{"id":113750096,"uuid":"502683927","full_name":"ocdbytes/webapp_backend_dockerised","owner":"ocdbytes","description":"Backend API dockerised. Made with python fast api library and then image is built out of it.","archived":false,"fork":false,"pushed_at":"2023-05-09T14:42:36.000Z","size":6341,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-14T10:46:09.914Z","etag":null,"topics":["docker","dockerfile","fastapi","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/ocdbytes.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}},"created_at":"2022-06-12T17:30:57.000Z","updated_at":"2022-06-12T17:37:33.000Z","dependencies_parsed_at":"2023-09-03T04:24:28.236Z","dependency_job_id":"6b950b63-9f8b-490e-8826-fc5a4f27dcf0","html_url":"https://github.com/ocdbytes/webapp_backend_dockerised","commit_stats":null,"previous_names":["ocdbytes/webapp_backend_dockerised"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2Fwebapp_backend_dockerised","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2Fwebapp_backend_dockerised/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2Fwebapp_backend_dockerised/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2Fwebapp_backend_dockerised/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocdbytes","download_url":"https://codeload.github.com/ocdbytes/webapp_backend_dockerised/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244470251,"owners_count":20457908,"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","dockerfile","fastapi","python"],"created_at":"2025-03-19T17:09:20.562Z","updated_at":"2025-03-19T17:09:20.996Z","avatar_url":"https://github.com/ocdbytes.png","language":"Python","readme":"# WebApp Dockerised\n\nWe need to first make a virtual environment for our application in our system\n\n```bash\npython3 -m venv venv\n. venv/bin/activate\n```\n\nThis project\n\n```bash\ndocker pull w3ts0ck3t/devops_project\n```\n\nNow we will create our requirements file in project root using\n\n```bash\npip freeze \u003e requirements.txt\n```\n\nLet's create our Dockerfile\n\n```Dockerfile\nFROM python:3.8\n\nWORKDIR /fastapi-app\n\nCOPY requirements.txt .\n\nRUN pip install -r requirements.txt\n\nCOPY ./app ./app\n\nCMD [\"python\", \"./app/main.py\"]\n```\n\nBuild our image on docker\n\n```bash\ndocker build -t python-fastapi-app .\n```\n\nIf we want to forward our port\n\n```bash\ndocker run -p 8000:8000 python-fastapi-app\n```\n\nIf we want to get the shell inside the container we can get it using\n\n```bash\ndocker exec -it \u003ccontainer_id/container_name\u003e /bin/sh\n```\n\nIf we want to push our image to docker hub\n\n```bash\ndocker tag python-fastapi-app:latest \u003cUSERNAME\u003e/\u003cREPO_NAME\u003e:latest\ndocker push \u003cUSERNAME\u003e/\u003cREPO_NAME\u003e:latest\n```\n\nAfter pushing pull the project\n\n```bash\ndocker pull \u003cUSERNAME\u003e/\u003cREPO_NAME\u003e:\u003cTAG\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focdbytes%2Fwebapp_backend_dockerised","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focdbytes%2Fwebapp_backend_dockerised","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focdbytes%2Fwebapp_backend_dockerised/lists"}