You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/install/containers/images/frontend.md
+48-20Lines changed: 48 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,12 @@ html_meta:
8
8
9
9
# `plone/plone-frontend`
10
10
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.
12
12
The frontend is written using React and requires a Plone backend to be running and accessible.
13
13
14
14
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.
15
15
16
16
17
-
## Using this image
18
-
19
-
20
17
## Configuration Variables
21
18
22
19
@@ -25,37 +22,65 @@ This image is **not a base image** to be extended in your projects, but an examp
25
22
26
23
| Environment variable | Description | Example |
27
24
| --- | --- | --- |
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: "`|
31
28
32
29
```{note}
33
30
For an extensive list of environment variables used by the frontend, visit {doc}`/volto/configuration/environmentvariables`.
34
31
```
35
32
36
-
## As an example for your volto project
37
33
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
39
35
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.
41
38
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
+
```
43
43
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.
45
45
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
+
```
47
63
48
64
```{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.
50
66
```
51
67
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
+
```
53
77
54
-
```Dockerfile
55
-
COPY entrypoint.sh /
56
-
ENTRYPOINT ["/entrypoint.sh"]
78
+
```diff
79
+
CMD ["yarn", "start:prod"]
80
+
+ENTRYPOINT ["/entrypoint.sh"]
57
81
```
58
82
83
+
59
84
### Build
60
85
61
86
Build your new image.
@@ -64,9 +89,10 @@ Build your new image.
64
89
docker build . -t myfrontend:latest -f Dockerfile
65
90
```
66
91
92
+
67
93
### Start it
68
94
69
-
You can use it in this `docker-compose.yml` file
95
+
You can use it in the following `docker-compose.yml` file.
70
96
71
97
```yaml
72
98
version: "3"
@@ -98,11 +124,13 @@ services:
98
124
- backend
99
125
```
100
126
101
-
To start, run
127
+
To start, run the following command.
128
+
102
129
```shell
103
130
docker compose up -d
104
131
```
105
132
133
+
106
134
## Versions
107
135
108
136
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