Skip to content

Commit c4af291

Browse files
committed
Clean up frontend doc
1 parent 9df910a commit c4af291

File tree

1 file changed

+48
-20
lines changed

1 file changed

+48
-20
lines changed

docs/install/containers/images/frontend.md

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@ html_meta:
88

99
# `plone/plone-frontend`
1010

11-
Plone 6 default frontend [Docker](https://www.docker.com/) image using Node.
11+
This chapter covers the Plone 6 default frontend [Docker](https://www.docker.com/) image using Node.
1212
The frontend is written using React and requires a Plone backend to be running and accessible.
1313

1414
This image is **not a base image** to be extended in your projects, but an example of the Plone user experience out of the box.
1515

1616

17-
## Using this image
18-
19-
2017
## Configuration Variables
2118

2219

@@ -25,37 +22,65 @@ This image is **not a base image** to be extended in your projects, but an examp
2522

2623
| Environment variable | Description | Example |
2724
| --- | --- | --- |
28-
| `RAZZLE_API_PATH` | Used to generate frontend calls to the backend. Needs to be a public url accessible by client browser | `http://api.site.org/++api++/` |
29-
| `RAZZLE_INTERNAL_API_PATH` | Used by the middleware to construct requests to the backend. It can be a non-public address | `http://backend:8080/Plone` |
30-
| `VOLTO_ROBOTSTXT` | Override the `robots.txt` file | `"User-agent: *\nDisallow: "` |
25+
| `RAZZLE_API_PATH` | Used to generate frontend calls to the backend. Needs to be a public URL accessible by client browser. | `http://api.site.org/++api++/` |
26+
| `RAZZLE_INTERNAL_API_PATH` | Used by the middleware to construct requests to the backend. It can be a non-public address. | `http://backend:8080/Plone` |
27+
| `VOLTO_ROBOTSTXT` | Override the `robots.txt` file. | `"User-agent: *\nDisallow: "` |
3128

3229
```{note}
3330
For an extensive list of environment variables used by the frontend, visit {doc}`/volto/configuration/environmentvariables`.
3431
```
3532

36-
## As an example for your volto project
3733

38-
To use this image as an example of a docker image for your own volto project, you will need to copy the [`Dockerfile`](https://github.com/plone/plone-frontend/blob/main/Dockerfile) file in your project.
34+
## Using as an example for your Volto project
3935

40-
In the `Dockerfile` file, replace the `yo @plone/volto` command with the `COPY . /build/plone-frontend` command.
36+
To use this image as an example of a Docker image for your own Volto project, you will need to edit the file `Dockerfile` in your project.
37+
`Dockerfile` is pulled from the root of the [`plone/plone-frontend`](https://github.com/plone/plone-frontend/) repository.
4138

42-
### Create a custom entrypoint
39+
```{note}
40+
The examples for `Dockerfile` in this documentation use Volto 15.x.
41+
You might need to adapt the examples for more recent releases.
42+
```
4343

44-
The `plone-frontend` docker image does not have a custom entrypoint file, so for any commands you need to run on docker container start, you will need to create it.
44+
In `Dockerfile` replace the `yo @plone/volto` command with the `COPY . /build/plone-frontend` command.
4545

46-
After creating the `entrypoint.sh` file, make sure it has execute permission by running `chmod 755 entrypoint.sh`.
46+
```diff
47+
# Generate new volto app
48+
- RUN yo @plone/volto \
49+
+ RUN COPY . /build/plone-frontend \
50+
plone-frontend \
51+
```
52+
53+
### Create a custom entry point
54+
55+
The `plone-frontend` Docker image does not have a custom entry point file.
56+
For any commands you need to run when starting your Docker container, you will need to create it.
57+
58+
After creating the `entrypoint.sh` file, make sure it has the execute permission:
59+
60+
```shell
61+
chmod 755 entrypoint.sh
62+
```
4763

4864
```{note}
49-
Do not forget to add the `exec "$@"` command at the end of the `entrypoint.sh` file, to run the default `yarn start` command.
65+
Do not forget to add the `exec "$@"` command at the end of the `entrypoint.sh` file to run the default `yarn start` command.
5066
```
5167

52-
In the `Dockerfile` you will need to add this 2 commands to make the docker container run it on start:
68+
In the `Dockerfile` you will need to add two commands to make the Docker container run `entrypoint.sh` on start:
69+
70+
```diff
71+
--no-interactive
72+
+
73+
+ COPY entrypoint.sh /
74+
75+
RUN cd plone-frontend \
76+
```
5377

54-
```Dockerfile
55-
COPY entrypoint.sh /
56-
ENTRYPOINT ["/entrypoint.sh"]
78+
```diff
79+
CMD ["yarn", "start:prod"]
80+
+ ENTRYPOINT ["/entrypoint.sh"]
5781
```
5882

83+
5984
### Build
6085

6186
Build your new image.
@@ -64,9 +89,10 @@ Build your new image.
6489
docker build . -t myfrontend:latest -f Dockerfile
6590
```
6691

92+
6793
### Start it
6894

69-
You can use it in this `docker-compose.yml` file
95+
You can use it in the following `docker-compose.yml` file.
7096

7197
```yaml
7298
version: "3"
@@ -98,11 +124,13 @@ services:
98124
- backend
99125
```
100126
101-
To start, run
127+
To start, run the following command.
128+
102129
```shell
103130
docker compose up -d
104131
```
105132

133+
106134
## Versions
107135

108136
For a complete list of tags and versions, visit the [`plone/plone-frontend` page on Docker Hub](https://hub.docker.com/r/plone/plone-frontend).

0 commit comments

Comments
 (0)