{"id":16890456,"url":"https://github.com/jedevc/docker-dino-demo","last_synced_at":"2026-05-04T16:35:24.706Z","repository":{"id":53648874,"uuid":"223220522","full_name":"jedevc/docker-dino-demo","owner":"jedevc","description":"🦕 Deploying a dinosaur web app using docker!","archived":false,"fork":false,"pushed_at":"2021-03-20T02:30:45.000Z","size":19,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T11:09:16.418Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jedevc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-21T16:46:52.000Z","updated_at":"2019-11-26T20:17:26.000Z","dependencies_parsed_at":"2022-09-11T00:51:29.264Z","dependency_job_id":null,"html_url":"https://github.com/jedevc/docker-dino-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jedevc/docker-dino-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedevc%2Fdocker-dino-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedevc%2Fdocker-dino-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedevc%2Fdocker-dino-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedevc%2Fdocker-dino-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jedevc","download_url":"https://codeload.github.com/jedevc/docker-dino-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedevc%2Fdocker-dino-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32615860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: 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":"2024-10-13T17:03:13.730Z","updated_at":"2026-05-04T16:35:24.683Z","avatar_url":"https://github.com/jedevc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker demo\n\n**This is the demo from my slides [here](https://docs.google.com/presentation/d/1K7yt9h-T9BoDUA_im8-Tqd-ok1N-tJGDwSGo6hTQkO0/edit?usp=sharing).**\n\nLet's deploy a flask web app in Docker!\n\n## Startup\n\nFirst let's build our image!\n\n    $ docker build . -t docker-dino\n\nNow we can run it:\n\n    $ docker run -d docker-dino\n    69a3f27004e6c62c5227d594e87aa969b48eedf45448d6f62aaa7182f409371b\n    $ docker ps\n    CONTAINER ID        IMAGE              COMMAND                  CREATED             STATUS              PORTS               NAMES\n    69a3f27004e6        docker-dino        \"/bin/sh -c 'gunicor…\"   14 seconds ago      Up 11 seconds       80/tcp              sharp_darwin\n\nAnd we can now see our container is now running. But how can we actually\naccess it?\n\nTo do that, we can restart our container, but this time expose port 80 from\nthe container to port 8080 on our host!\n\n    $ docker kill 69a3f27004e6\n    69a3f27004e6\n    $ docker run -p 8000:80 -d docker-dino \n    74470db53fe64cc0b457afb1ba6552145f267c698ddaa28624a62832812d1a16\n    $ docker ps\n    CONTAINER ID        IMAGE              COMMAND                  CREATED             STATUS                  PORTS                  NAMES\n    74470db53fe6        docker-dino        \"/bin/sh -c 'gunicor…\"   2 seconds ago       Up Less than a second   0.0.0.0:8000-\u003e80/tcp   recursing_khorana\n\nNow that the port is published, we can access our site:\n\n    $ curl localhost:8000\n    Hello World (and dinosaurs)!\n\n## File uploads\n\nLet's try and send a file to our website.\n\n    $ curl http://localhost:8000/upload -F \"file=@dino.txt\"\n    \u003c!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\"\u003e\n    \u003ctitle\u003e500 Internal Server Error\u003c/title\u003e\n    \u003ch1\u003eInternal Server Error\u003c/h1\u003e\n    \u003cp\u003eThe server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.\u003c/p\u003e\n\nUh oh! We got an internal server error!\n\nDocker lets us peek inside the container to have a look what's going on.\n\n    $ docker logs 74470db53fe6\n    [2019-11-21 16:27:54 +0000] [6] [INFO] Starting gunicorn 20.0.0\n    [2019-11-21 16:27:54 +0000] [6] [INFO] Listening at: http://0.0.0.0:80 (6)\n    [2019-11-21 16:27:54 +0000] [6] [INFO] Using worker: sync\n    [2019-11-21 16:27:54 +0000] [10] [INFO] Booting worker with pid: 10\n    [2019-11-21 16:28:08,911] ERROR in app: Exception on /upload [POST]\n    Traceback (most recent call last):\n    ...\n    File \"/app/dino/dino.py\", line 27, in upload\n        file.save(os.path.join(UPLOADS, out_filename))\n    ...\n    FileNotFoundError: [Errno 2] No such file or directory: '/app/uploads/dino.txt'\n\nAha! The directory we're trying to upload files to doesn't exist!\n\nWe'll fix this later in the Dockerfile, but for now, we'll use another\ntechnique to patch the container while it's running!\n\n    $ docker exec -it 74470db53fe6 /bin/bash\n    root@74470db53fe6:/app# ls\n    Pipfile  Pipfile.lock  README.md  demo\n    root@74470db53fe6:/app# mkdir uploads\n\nNow we want to exit the container with ctrl-d and we can try the upload again:\n\n    $ curl http://localhost:8000/upload -F \"file=@dino.txt\"\n    \u003c!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\"\u003e\n    \u003ctitle\u003eRedirecting...\u003c/title\u003e\n    \u003ch1\u003eRedirecting...\u003c/h1\u003e\n    \u003cp\u003eYou should be redirected automatically to target URL: \u003ca href=\"/files/dino.txt\"\u003e/files/dino.txt\u003c/a\u003e.  If not click the link.\n\nGreat! We should then be able to easily get the dinosaur:\n\n    $ curl http://localhost:8000/dinos/dino.txt\n           __\n          /oo\\\n         |    |\n     ^^  (vvvv)   ^^\n     \\\\  /\\__/\\  //\n      \\\\/      \\//\n       /        \\        \n      |          |    ^  \n      /          \\___/ | \n     (            )     |\n      \\----------/     /\n        //    \\\\_____/\n       W       W \n\nWe can then patch our Dockerfile for future containers:\n\n```Dockerfile\n...\nENV UPLOADS_DIR=uploads/\nRUN mkdir -p uploads/\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedevc%2Fdocker-dino-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjedevc%2Fdocker-dino-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedevc%2Fdocker-dino-demo/lists"}