{"id":42503811,"url":"https://github.com/dataforgoodfr/batch4_diafoirus_mimic","last_synced_at":"2026-01-28T13:37:36.739Z","repository":{"id":93377191,"uuid":"127571832","full_name":"dataforgoodfr/batch4_diafoirus_mimic","owner":"dataforgoodfr","description":"Dockerized postgres running Mimic","archived":false,"fork":false,"pushed_at":"2018-05-09T17:19:55.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-24T10:06:56.583Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/dataforgoodfr.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}},"created_at":"2018-03-31T21:14:10.000Z","updated_at":"2018-05-09T17:19:56.000Z","dependencies_parsed_at":"2023-08-12T06:16:53.554Z","dependency_job_id":null,"html_url":"https://github.com/dataforgoodfr/batch4_diafoirus_mimic","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":"0.36363636363636365","last_synced_commit":"b7e37830f4ca0aecdc320962d329ab90c0840f86"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dataforgoodfr/batch4_diafoirus_mimic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataforgoodfr%2Fbatch4_diafoirus_mimic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataforgoodfr%2Fbatch4_diafoirus_mimic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataforgoodfr%2Fbatch4_diafoirus_mimic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataforgoodfr%2Fbatch4_diafoirus_mimic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dataforgoodfr","download_url":"https://codeload.github.com/dataforgoodfr/batch4_diafoirus_mimic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataforgoodfr%2Fbatch4_diafoirus_mimic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28846053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T13:02:32.985Z","status":"ssl_error","status_checked_at":"2026-01-28T13:02:04.945Z","response_time":57,"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-01-28T13:37:35.994Z","updated_at":"2026-01-28T13:37:36.733Z","avatar_url":"https://github.com/dataforgoodfr.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mimic Database installation with Docker\n\nWhat we are going to do here is to break down every steps required for setting up a working environment. \n\nThe goal is:\n* To ease your life so you don't lose too much type trying to figure out non-important stuff (non-related to our main goal)\n* To have a common environment for all team members, so communication and workflow can spread more easily.\n\nThe database will be run inside a Docker container. You'll have access to this container through ports mapping.\n\nIf you don't know anything about Docker, you may want to start by following the quick [Get Started](https://docs.docker.com/get-started/) tutorial. Moreover, [this blog post](https://blog.docker.com/2016/03/containers-are-not-vms/) should explain why a Docker container is useful, and what are the differences between a container and a classic virtual machine.\n\nStarting from now, we assume that [Docker is installed](https://docs.docker.com/install/) on your machine, as well as [docker-compose](https://docs.docker.com/compose/install/), a program we will use to build the Docker container.\n\n## 1. Clone this Github repository on your machine\n\n    $ git clone git@github.com:dataforgoodfr/batch4_diafoirus_mimic.git\n    $ cd batch4_diafoirus_mimic\n    \n## 2. Get the data\nNow, move to the directory we'll use for storing the data\n    \n    $ cd mimic_data/csv\n    \n`NOTE` For the following command, your access to the database must first have been granted by **Physionet.org**.\n\n**Warning:** replace `{EMAIL}` with the email you used to log in physionet.org.\n\n    $ wget --user {EMAIL} --ask-password -A csv.gz -m -p -E -k -K -np -nd https://physionet.org/works/MIMICIIIClinicalDatabaseDemo/files/ \n\n*You will be prompted to enter your physionet.org password.*\n\n`NOTE` This is **only the test database** (light version). We are currently working on making sure that everything works with the actual/enormous database.\n\nThis will download all the `csv.gz` (compressed CSV) files that composed the database. The compressed CSVs are about 6 GB in total, so it may take a while!\n\n---\n\nIf the automatic dowloads with `wget` fails on the very big files, you can [download each of them manually here](https://physionet.org/works/MIMICIIIClinicalDatabase/files/) `right clic -\u003e save target` (access restricted to granted users only, of course)\n\nThen go back to the root of our directory\n\n    $ cd ../..\n    \n## 3. Build the image and run the container\n\nThis is the magic command :)\n\n    $ sudo docker-compose up --build\n\n**This will take a while** (probably a few hours), since it has to copy all the data to the container's system. \n\n*`NOTE` Sometimes, the process will exit quickly, with this message `ERROR: Service 'postgres' failed to build`. In that case, try re-launching the same command, as it can work with no problem the second time.*\n\nWhen it's done, the container should be up and running with a seeded postgres on port `5432`. You're now free to connect to it (user: `mimic`, password: `mimic`)\n\nIf you want to connect to the database through the terminal keep reading, otherwise **congratulations, you are all set!**\n\n`NOTE` You can stop the container using `CTRL-C` \n## 4. Restart the container\nWhen you reboot your machine and you want to relauch the container, you can use the `docker-compose` command we used earlier, but add the `-d` flag to run the container as *daemon* (= as a background task)\n\n    $ sudo docker-compose up --build -d\n\n----------------\nThe following steps are optionnal, or are just provided as complementary observations.\n\n### Log into the container's shell\n\n    $ sudo docker exec -it mimic /bin/bash\n    \nYou should have a shell access to the container. \n\n`NOTE` after this command, you are executing **inside** the container, and not on your local machine anymore. You can exit the container with `CTRL-C`.\n    \n### Connect to postgres\n\n    $ psql -U mimic\n    \n### Run SQL queries\nTo list all the tables within the database\n\n    $ \\d \n    \nIf you don't see anything returning from this command, there is a problem :)\n\nOtherwise, congratulations! You can start querying the database, for example...\n  \n    $ SELECT row_id FROM admissions limit 10;\n\n... should return a list of the first 10 indexes of the `admissions` table.\n\n`NOTE` don't forget the `;` at the end of any SQL queries...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataforgoodfr%2Fbatch4_diafoirus_mimic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdataforgoodfr%2Fbatch4_diafoirus_mimic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataforgoodfr%2Fbatch4_diafoirus_mimic/lists"}