{"id":19141823,"url":"https://github.com/nyuuuukie/inception","last_synced_at":"2026-05-15T11:34:22.741Z","repository":{"id":129334855,"uuid":"384619824","full_name":"nyuuuukie/inception","owner":"nyuuuukie","description":"An introduction to docker-compose used to build and run containers with nginx, mariadb, wordpress, adminer, ftp, redis, cadvisor and prometheus","archived":false,"fork":false,"pushed_at":"2022-09-26T19:11:57.000Z","size":1050,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-03T15:16:17.229Z","etag":null,"topics":["42projects","arm64","docker-compose","inception"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/nyuuuukie.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":"2021-07-10T05:39:41.000Z","updated_at":"2022-12-06T16:40:27.000Z","dependencies_parsed_at":"2023-04-25T13:16:20.314Z","dependency_job_id":null,"html_url":"https://github.com/nyuuuukie/inception","commit_stats":null,"previous_names":["nyuuuukie/inception"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nyuuuukie%2Finception","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nyuuuukie%2Finception/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nyuuuukie%2Finception/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nyuuuukie%2Finception/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nyuuuukie","download_url":"https://codeload.github.com/nyuuuukie/inception/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240222499,"owners_count":19767458,"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":["42projects","arm64","docker-compose","inception"],"created_at":"2024-11-09T07:24:51.058Z","updated_at":"2026-05-15T11:34:17.711Z","avatar_url":"https://github.com/nyuuuukie.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inception\n\n## Description\n\nThe aim of this project is to build and up the following services using docker-compose:\n- MariaDB\n- Wordpress\n- NGiNX\n- Adminer\n- FTP\n- Redis Cache\n- Cadvisor\n- Prometheus\n\nAs a one of the bonus, there is also a static webpage.\n## VM\n\nIf your device has x86 arch, use VirtualBox and skip this block. (use `uname -m`, padawan)\n\nI've done this project using Macbook Air (M1, ARM64)\n\n\u003cdetails\u003e\n\u003csummary\u003eIf you want to do this project on M1 either, read the spoiler:\u003c/summary\u003e\n\n### UTM\n\nVirtualBox is not supported ARM, and as I read from the forum, they are not planning to do ARM version of it.\n\n[UTM](https://mac.getutm.app/) turned out to be a great replacement for VB.\n\nOnce installed go the the [gallery](https://mac.getutm.app/gallery/) and select the image of the VM. \u003cbr\u003e\nMy choice was Debian 10.4 (LDXE), you can choose another. Even MacOS can be installed over your MacOS :)\n\nTo install shared folder, use [this](/SHARED_FOLDER.md) instruction.\n\n\u003chr\u003e\n\n### Docker\n\nOfficial docker docs [says](https://docs.docker.com/desktop/mac/apple-silicon/) :\n\u003e Some command line tools do not work when Rosetta 2 is not installed. \u003cbr\u003e\nThe old version 1.x of docker-compose. We recommend that you use Compose V2 instead. \u003cbr\u003e\nEither type docker compose or enable the Use Docker Compose V2 option in the General preferences tab.\n\nI decided to work with `docker compose` instead of `docker-compose` and it worked excellent.\n\n\u003c/details\u003e\n\n:warning: Do not forget to add docker group to current user!\n\n## Info, tips \u0026 links\n\n```\n.env file contains sensitive data in the enviroment variables.\nNever store production environment and any important data in the repo!\n```\n\nBefore writing Dockerfiles read the following and understand the concept of docker-init:\n- [How to write your daemon](http://www.netzmafia.de/skripten/unix/linux-daemon-howto.html)\n- [PID 1 and daemons](https://it-lux.ru/docker-entrypoint-pid-1/#1-%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D1%8B-entrypoint-ampamp-cmd)\n- [PID 1 and daemons](https://medium.com/hackernoon/my-process-became-pid-1-and-now-signals-behave-strangely-b05c52cc551c)\n- [CMD vs ENTRYPOINT](https://habr.com/ru/company/southbridge/blog/329138/)\n\nIn all the containers I have used `envsubst` to replace env variables in the config files.\n\n\u003chr\u003e\n\n### MariaDB\nThis is the first service you should up, because for mandatory part you have dependency chain:\n\nMariaDB -\u003e Wordpress -\u003e Nginx\n\nI could not install MariaDB on alpine 3.14, so I used alpine 3.7 for this container.\n\n\u003chr\u003e\n\n### Wordpress\n\nWordpress is working under `php-fpm`, so I proxied to wordpress:port with `fastcgi_pass`.\n\nGo ahead and take a look at a [useful site](https://wp-kama.ru/handbook/wp-cli) with a descriptions of wp-cli commands.\n\n\u003chr\u003e\n\n### Nginx\n\nI've used a [bash script](/srcs/requirements/tools/gencert.sh) to generate certificates.\n\nThis script is called from the Makefile and it produces CA key, CA crt, server key and server crt files. \u003cbr\u003e\nCertificates passed to containers through separate volume.\n\nYou can manually add CA certificate to the browser to avoid 'insecure' error.\n[Add certificate to Mozilla Firefox](https://docs.vmware.com/en/VMware-Adapter-for-SAP-Landscape-Management/2.1.0/Installation-and-Administration-Guide-for-VLA-Administrators/GUID-0CED691F-79D3-43A4-B90D-CD97650C13A0.html)\n\nAs for Nginx, `ssl_protocols TLSv1.2 TLSv1.3;` must be specified in config file.\n\nIn this project nginx is the entry point to all the services, except ftp.\n\n\u003chr\u003e\n\n### Adminer\n\nAdminer is working under `php-fpm` as well, so I proxied to adminer:port with `fastcgi_pass`.\nYou can also start it under `php` and proxy with `proxy_pass` \n\n\u003chr\u003e\n\n### Redis\n\nRedis running in the separate container, and should be installed and activated as a wordpress plug-in.\n\nIt is OK for `protected-mode no` to be set in the `redis.conf`, as container is working only in the internal network \u003cbr\u003e\nand has no access point from outside.\n\n\u003chr\u003e\n\n### FTP\n\nPort 21 and a range of passive ports are opened for FTP, see [docker-compose.yml](/srcs/docker-compose.yml#L184)\n\nAs for ftp client, I used [this](https://lftp.yar.ru/) called lftp.\u003cbr\u003e\nlftp is a terminal client that supports a number of network protocols (ftp, http, sftp...).\n\nHere is some examples of lftp usage:\n```bash\n# First, connect to some ftp server:\n# lftp -u ftp_user ftp://mhufflep.42.fr\n\n# ls               # List files\n# put \u003cfile_path\u003e  # Upload file\n# get \u003cfile_path\u003e  # Download file\n# rm  \u003cfile_path\u003e  # Remove file\n```\n\nFor self-signed certificates with local CA, add this line to lftp config (`/etc/lftp.conf` on my system):\n```conf\nset ssl:ca-file \"/etc/ssl/certs/ca-certificates.crt\"\n```\n\n\n### cAdvisor \u0026 Prometheus\n\nThe info about these services could be found on the official pages:\n- [cAdvisor](https://github.com/google/cadvisor)\n- [prometheus](https://prometheus.io/docs/introduction/overview/)\n\nBoth of them are builded directly from their github repos.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnyuuuukie%2Finception","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnyuuuukie%2Finception","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnyuuuukie%2Finception/lists"}