Add Docker setup guide for application templates#394
Conversation
Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
|
@copilot update it considering yiisoft/app@a75636d |
Agent-Logs-Url: https://github.com/yiisoft/docs/sessions/8588b852-e4f6-4135-bf2d-4b4c9576a32c Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
Done in 811b9cd. The guide now documents the new root-level
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Agent-Logs-Url: https://github.com/yiisoft/docs/sessions/9e326ae8-eb08-471e-93b4-66dc9425e656 Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new tutorial page documenting the Docker setup used by Yii application templates, and wires it into the guide navigation while updating the project creation workflow to reference .env.example.
Changes:
- Added a new Docker tutorial page covering directory layout, env files, Compose setup, multi-stage builds, and
maketargets. - Added navigation entries for the new page (Guide index + VitePress sidebar).
- Updated “Creating a project” to reference the
.env.example→.envworkflow and clarified port configuration notes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/guide/tutorial/docker.md | New Docker setup guide for yiisoft/app and yiisoft/app-api, including env/compose/multi-stage build and make command docs. |
| src/guide/start/creating-project.md | Updates local setup instructions to mention .env.example and improves the port-change note. |
| src/guide/index.md | Adds a “Docker in application templates” link under Special topics. |
| src/.vitepress/config.js | Adds the Docker guide page to the Tutorial sidebar section. |
Comments suppressed due to low confidence (1)
src/guide/start/creating-project.md:48
- The instructions say to copy
.env.exampleto.env, but the following shell snippet only shows./yii serve. Add thecp .env.example .envstep to the code block (or adjust the prose) so readers can follow the workflow without guessing.
Go into the newly created directory, copy `.env.example` to `.env`, and run:
```sh
./yii serve --port=80
</details>
|
|
||
| FROM base AS prod-builder | ||
| COPY --from=composer /composer /usr/bin/composer | ||
| COPY .. /app |
There was a problem hiding this comment.
In the documented Dockerfile snippet, COPY .. /app will fail when the build context is the project root (as shown in the Compose example with context: ..) because Docker cannot copy files from outside the build context. Update the snippet to copy from within the build context (for example, COPY . /app) or adjust the documented build context accordingly.
| COPY .. /app | |
| COPY . /app |
| The Dockerfile defines four stages: | ||
|
|
||
| | Stage | Purpose | | ||
| |----------------|--------------------------------------------------------------------------------------------------| | ||
| | `composer` | Copies the Composer binary from the official image to avoid installing it in other stages. | | ||
| | `base` | Installs FrankenPHP, common PHP extensions, and system packages shared by all environments. | | ||
| | `dev` | Extends `base` with Xdebug and Composer. Creates a non-root user matching the host user's UID/GID to prevent permission issues with mounted volumes. | | ||
| | `prod-builder` | Extends `base`, copies the application source, and runs `composer install --no-dev` using a build cache. Removes `composer.lock` and `composer.json` afterwards to keep the final image clean. | | ||
| | `prod` | Copies only the built application from `prod-builder` into a clean `base` image. This produces a small final image because the Composer binary and intermediate files are not included. | |
There was a problem hiding this comment.
This sentence says the Dockerfile defines four stages, but the table lists five (composer, base, dev, prod-builder, prod). Update the count (or clarify that composer is a helper stage) to avoid confusion.
| ``` | ||
|
|
||
| Instead of building an image, the production file references a pre-built image (`${IMAGE}:${IMAGE_TAG}`). | ||
| The `deploy` block configures Docker Swarm behaviour: two replicas with a rolling `start-first` update |
There was a problem hiding this comment.
Spelling inconsistency: the docs elsewhere use American English "behavior"; this line uses "behaviour". Consider changing to "behavior" to keep wording consistent (and to avoid potential Vale style failures).
| The `deploy` block configures Docker Swarm behaviour: two replicas with a rolling `start-first` update | |
| The `deploy` block configures Docker Swarm behavior: two replicas with a rolling `start-first` update |
src/guide/tutorial/docker.md- the Docker guide page covering all 5 required topicssrc/.vitepress/config.jsto add the page to the Tutorial sidebar sectionsrc/guide/index.mdto add a link in the Special topics sectionsrc/guide/tutorial/docker.mdto document the new root.env.examplefor non-Docker development and the Docker env priority (yiisoft/app@a75636d)src/guide/start/creating-project.mdto use the new.env.example→.envworkflow, correct URL/port note, and name the.env.examplefile explicitly in proseOriginal prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.