{"id":21739338,"url":"https://github.com/weaponsforge/gatsby-dockerfiles","last_synced_at":"2025-03-21T00:44:29.916Z","repository":{"id":264661194,"uuid":"893688308","full_name":"weaponsforge/gatsby-dockerfiles","owner":"weaponsforge","description":"A collection of Dockerfiles for various Gatsby CLI versions","archived":false,"fork":false,"pushed_at":"2024-11-26T18:56:19.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T21:26:18.150Z","etag":null,"topics":["dev-tools","docker","gatsby","gatsby-cli","gatsby-docker","tools"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/weaponsforge/gatsby-cli","language":"Slim","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/weaponsforge.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-25T03:02:16.000Z","updated_at":"2025-01-06T02:30:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"107beeb9-8a7a-40e8-bd3c-b565b9eae857","html_url":"https://github.com/weaponsforge/gatsby-dockerfiles","commit_stats":null,"previous_names":["weaponsforge/gatsby-dockerfiles"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaponsforge%2Fgatsby-dockerfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaponsforge%2Fgatsby-dockerfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaponsforge%2Fgatsby-dockerfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaponsforge%2Fgatsby-dockerfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weaponsforge","download_url":"https://codeload.github.com/weaponsforge/gatsby-dockerfiles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244717336,"owners_count":20498283,"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":["dev-tools","docker","gatsby","gatsby-cli","gatsby-docker","tools"],"created_at":"2024-11-26T06:08:33.032Z","updated_at":"2025-03-21T00:44:29.911Z","avatar_url":"https://github.com/weaponsforge.png","language":"Slim","readme":"## gatsby-dockerfiles\n\nA collection of development Dockerfiles for running various [Gatsby CLI](https://www.gatsbyjs.com/docs/reference/gatsby-cli/) versions in containers as an alternative to global installation `\"npm install -g gatsby-cli\"` on a host machine.\n\nThis repository contains references to Gatsby CLI Docker recipes and notes about which Node version(s) are compatible with each CLI version for quick look-ups and inspection of existing Gatsby [themes](https://jamstackthemes.dev/theme/#ssg=gatsby) and [starters](https://www.builtatlightspeed.com/category/gatsby).\n\n### 📦 Gatsby Dependencies\n\nHere are some known Gatsby CLI versions and their compatible Node versions.\n\n| Gatsby CLI | Gatsby CLI\u003cbr\u003elatest | Gatsby CLI\u003cbr\u003eVersion | Compatible Node\u003cbr\u003eVersions | Docker Review |\n| :---: | :---: | :---: | :---: | --- |\n| v5 | - | v5.14.0 | v18.x (LTS), v20.x  | Build success |\n| v4 | [latest-v4](https://www.npmjs.com/package/gatsby-cli/v/latest-v4) | v4.25.0 | 14.x, 16.x, or 18.x | Build success |\n| v3 | [latest-v3](https://www.npmjs.com/package/gatsby-cli/v/latest-v3) | v3.15.0 | 12.x, 14.x, or 16.x | Build success |\n| v2 | [latest-v2](https://www.npmjs.com/package/gatsby-cli/v/latest-v2) | v2.19.3 | v12.x | Needs native libs for building the sharp image lib; often missing built libs for the webp format |\n\n## 🛠️ Initialization\n\n1. [Create a new Gatsby app](https://www.gatsbyjs.com/docs/tutorial/getting-started/), or use one of the existing [templates](https://www.builtatlightspeed.com/category/gatsby) or [themes](https://jamstackthemes.dev/theme/#ssg=gatsby).\n\n2. Take note of the app's required Gatsby CLI and Node version, which can be deduced from its `\"package.json,\"` `\"package-lock.json,\"` or `\"yarn.lock\"` files.\n   \u003e **TIP:** Use the recommended Node version in the host machine when using **only Node** and the **global Gatsby CLI installation** for development. For example, to initialize a new Gatsby app using the **Gatsby CLI v4**, switch to Node 16.14.2 - `\"nvm use 16.14.2.\"`\n\n3. Use the Dockerfiles inside the **/v2**, **/v3**, **/v4**, or **/v5** directories for reference to build a target Gatsby CLI Docker image.\n\n   | Folder | Contents | Image | Image Tag |\n   | :---: | --- | :---: | :---: |\n   | **/v5** | Dockerfiles and compose files for **`Gatsby CLI v5`**\u003cbr\u003e\u003csub\u003edocker-compose.v5.20x.yml - CLI for Node 20.x\u003cbr\u003edocker-compose.v5.18x.yml - CLI for Node 18.x\u003c/sub\u003e | weaponsforge/gatsby-cli | v5-node20\u003cbr\u003ev5-node18 |\n   | **/v4** | Dockerfiles and compose files for **`Gatsby CLI v4`**\u003cbr\u003e\u003csub\u003edocker-compose.v4.18x.yml - CLI for Node 18.x\u003cbr\u003edocker-compose.v4.16x.yml - CLI for Node 16.x\u003c/sub\u003e | weaponsforge/gatsby-cli | v4-node18\u003cbr\u003ev4-node16 |\n   | **/v3** | Dockerfiles and compose files for **`Gatsby CLI v3`**\u003cbr\u003e\u003csub\u003edocker-compose.v3.14x.yml - CLI for Node 14.x | weaponsforge/gatsby-cli | v3-node14 |\n   | **/v2** | Dockerfiles and compose files for **`Gatsby CLI v2`**\u003cbr\u003e\u003csub\u003edocker-compose.v2.yml - CLI for Node 12.x | weaponsforge/gatsby-cli | v2-node12 |\n\n4. Build a Gatsby CLI image. For example, to build the **Gatsby CLI v4** image, navigate first to the **/v4** directory, then run:\n   ```bash\n   docker compose -f docker-compose.v4-16x.yml build\n   ```\n\n## 🚀 Usage\n\nRun the Gatsby CLI in Docker. For example, to run the **Gatsby CLI v4** [API commands](https://www.gatsbyjs.com/docs/reference/gatsby-cli/#api-commands) (using PowerShell):\n\n- **Gatsby CLI available API commands:**\n   ```bash\n   docker run -it --rm -v ${pwd}:/app weaponsforge/gatsby-cli:v4-node18 gatsby \u003cAPI_COMMAND\u003e\n   ```\n\n- **Create a new Gatsby app using the `\"gatsby new\"` command**:\n   ```bash\n   docker run -it --rm -v ${pwd}:/app -w /app weaponsforge/gatsby-cli:v4-node18 gatsby new\n   ```\n\n- **Run the `\"gatsby develop\"` command (inside a Gatsby app directory):**\n   ```bash\n   docker run -it --rm -v ${pwd}:/app -w /app -v /app/node_modules -p 8000:8000 weaponsforge/gatsby-cli:v4-node18 sh -c \"npm install \u0026\u0026 gatsby develop -H 0.0.0.0 --verbose\"\n   ```\n\n- **Create a `Docker compose` YML file to run an existing Gatsby app** (an alternate option to the previous step):\u003cbr\u003e\n\n   ```yaml\n   services:\n     gatsby-app:\n       image: weaponsforge/gatsby-cli:v4-node16\n       working_dir: /app\n       volumes:\n         - .:/app\n         - /app/node_modules\n       ports:\n         - \"8000:8000\"\n       command: sh -c \"npm install \u0026\u0026 gatsby develop --host 0.0.0.0\"\n   ```\n\n\u003cbr\u003e\n\n\u003e [!TIP]\n\u003e Run the dockerized Gatsby CLI API commands using different Docker volume mount combinations to achieve the best results.\n\n## ⚡ Alternate Usage\n\nPre-built Docker images are available for each Gatsby CLI and generic Node versions at:\u003cbr\u003e\nhttps://hub.docker.com/r/weaponsforge/gatsby-cli\n\n@weaponsforge\u003cbr\u003e\n20241125\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaponsforge%2Fgatsby-dockerfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweaponsforge%2Fgatsby-dockerfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaponsforge%2Fgatsby-dockerfiles/lists"}