{"id":23462017,"url":"https://github.com/cslant/blog-docker","last_synced_at":"2025-04-14T06:54:37.143Z","repository":{"id":247613608,"uuid":"818974260","full_name":"cslant/blog-docker","owner":"cslant","description":"This repo is to set up the CSlant blog with docker 🐳","archived":false,"fork":false,"pushed_at":"2024-11-08T19:58:16.000Z","size":394,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-27T20:41:20.979Z","etag":null,"topics":["blog","cslant","cslant-blog","cslant-cicd","cslant-docker","cslant-runner","docker-compose","runner"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/cslant","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/cslant.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":"2024-06-23T12:14:51.000Z","updated_at":"2024-11-08T19:57:44.000Z","dependencies_parsed_at":"2024-11-08T20:38:40.148Z","dependency_job_id":null,"html_url":"https://github.com/cslant/blog-docker","commit_stats":null,"previous_names":["cslant/blog-docker"],"tags_count":97,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cslant%2Fblog-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cslant%2Fblog-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cslant%2Fblog-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cslant%2Fblog-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cslant","download_url":"https://codeload.github.com/cslant/blog-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837281,"owners_count":21169374,"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":["blog","cslant","cslant-blog","cslant-cicd","cslant-docker","cslant-runner","docker-compose","runner"],"created_at":"2024-12-24T08:15:28.681Z","updated_at":"2025-04-14T06:54:37.107Z","avatar_url":"https://github.com/cslant.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"```text\n ██████╗███████╗██╗      █████╗ ███╗   ██╗████████╗    ██████╗ ██╗      ██████╗  ██████╗ \n██╔════╝██╔════╝██║     ██╔══██╗████╗  ██║╚══██╔══╝    ██╔══██╗██║     ██╔═══██╗██╔════╝ \n██║     ███████╗██║     ███████║██╔██╗ ██║   ██║       ██████╔╝██║     ██║   ██║██║  ███╗\n██║     ╚════██║██║     ██╔══██║██║╚██╗██║   ██║       ██╔══██╗██║     ██║   ██║██║   ██║\n╚██████╗███████║███████╗██║  ██║██║ ╚████║   ██║       ██████╔╝███████╗╚██████╔╝╚██████╔╝\n ╚═════╝╚══════╝╚══════╝╚═╝  ╚═╝╚═╝  ╚═══╝   ╚═╝       ╚═════╝ ╚══════╝ ╚═════╝  ╚═════╝ \n```\n\n# CSlant blog docker installer\n\nThis repo is to set up the CSlant blog with Docker.\n\nWe can use this runner to update the blog for development and production.\n\n## Docker Hub\n\n[CSlant Docker Hub](https://hub.docker.com/r/cslant)\n\nIn this docker repository, we have built the following images:\n\n- [cslant/blog-php](https://hub.docker.com/r/cslant/blog-php)\n- [cslant/blog-worker](https://hub.docker.com/r/cslant/blog-worker)\n- [cslant/blog-node](https://hub.docker.com/r/cslant/blog-node)\n- [cslant/blog-nginx](https://hub.docker.com/r/cslant/blog-nginx)\n- [cslant/blog-postgres](https://hub.docker.com/r/cslant/blog-postgres)\n\n---\n\n## Prerequisites\n\nFirst, copy the `.env.example` file to `.env` and update the values.\n\n```bash\nenvsubst \u003c .env.example \u003e .env\n```\n\nIf you don't have `envsubst` command, you can use the following command:\n\n```bash\ncp .env.example .env\n```\n\n## Installation\n\nIn the `.env` file, update the values to match your environment.\n\n```dotenv\n# .env file\n# ...\n\n# Path to your code folder\nSOURCE_CODE_PATH=/Users/tanhongit/CSlant/blog/source\n\nGIT_SSH_URL=\"git@github.com:cslant\"\nGIT_TOKEN=\"ghp_1234567890\"\n\n## DOMAIN SETTING\nCSLANT_DOMAIN=cslant.com.local\nBLOG_DOMAIN=blog.cslant.com.local\nBLOG_API_DOMAIN=api.blog.cslant.com.local\nBLOG_ADMIN_DOMAIN=admin.blog.cslant.com.local\n\nBLOG_ADMIN_DIR=hello\n\nFE_COMMAND=dev\n```\n\n\u003e [!IMPORTANT]\n\u003e ### Command can't be used if wrong values are set in the `.env` file.\n\u003e \n\u003e 1. If the `SOURCE_CODE_PATH` is wrong, the runner will not be able to find the source code. So, please make sure the `SOURCE_CODE_PATH` is correct.\n\u003e\n\u003e       - So please get the full path of the `SOURCE_CODE_PATH` with the following command:\n\u003e \n\u003e       ```bash\n\u003e       pwd\n\u003e       ```\n\u003e \n\u003e 2. Ensure the `GIT_SSH_URL` and `GIT_TOKEN` are correct. If the values are wrong, the runner will not be able to sync the repositories.\n\u003e \n\u003e       - Please get `GIT_TOKEN` from [here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic).\n\n### 💻 Start in Mac with arm64\n\nTo run as amd64. You need to set the default platform to `linux/amd64`:\n\n```shell\nexport DOCKER_DEFAULT_PLATFORM=linux/amd64\n```\n\n### Run the runner\n\nThen, you can just run the following command to start the runner.\n\n```bash\nbash runner.sh all\n```\n\nThe above command will run all the commands in the runner and start `nginx`, `php`, `node`, `fe` , `postgres` and `elasticsearch` services.\n\n---\n\nIf you want to start all the services, you can use the following command:\n\n```bash\nbash runner.sh all\nbash runner.sh start_all\n```\n\n### Update host file\n\nAdd the following lines to the `/etc/hosts` file:\n\n```bash\n127.0.0.1       blog.cslant.com.local admin.blog.cslant.com.local api.blog.cslant.com.local\n```\n\nIf you're using another domain, please update the domain in the `.env` file and update the domain in the `/etc/hosts` file as well.\n\n---\n\n## Usage\n\nThe runner has the following commands:\n\n| Command           | Description                          |\n|-------------------|--------------------------------------|\n| `help`, `h`       | Shows the help message               |\n| `git_sync`, `gs`  | Syncs the blog repositories          |\n| `network`, `n`    | Creates the Docker network           |\n| `build`, `b`      | Builds the blog with Docker          |\n| `build_all`, `ba` | Builds all blog services with Docker |\n| `start`, `s`      | Starts the blog services in Docker   |\n| `start_all`, `sa` | Starts all blog services in Docker   |\n| `install`, `i`    | Install all blog dependencies        |\n| `update`, `u`     | Update all blog dependencies         |\n| `resource`, `r`   | Download blog resources              |\n| `es_import`, `ei` | Import data to Elasticsearch         |\n| `all`, `a`        | Runs all the commands                |\n\nTo run a specific command, use the following command:\n\n```bash\nbash runner.sh \u003ccommand\u003e\n```\n\nFor example, to run the `help` command to show the help message, use the following command:\n\n```bash\nbash runner.sh help\n```\n\n---\n\n## Backup database in Docker\n\nBackup this blog database to a SQL file:\n\n```bash\npg_dump -U username -h hostname database_name \u003e\u003e /path/to/backup.sql\n```\n\nExample in this Docker:\n\n```bash\npg_dump -U root -h localhost cslant_blog \u003e\u003e /docker-entrypoint-initdb.d/cslant_blog.sql\n```\n\n## Restore database in Docker\n\n```bash\npsql -U root -h localhost cslant_blog \u003c /docker-entrypoint-initdb.d/cslant_blog.sql\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcslant%2Fblog-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcslant%2Fblog-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcslant%2Fblog-docker/lists"}