Skip to content

Commit 92213f0

Browse files
committed
Add the feature to set the default locale of Silverpeas when spawning a container from the docker image.
1 parent fb71f23 commit 92213f0

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ARG SILVERPEAS_VERSION=6.0-alpha1
66
ARG WILDFLY_VERSION=10.0.0
77
ARG DEFAULT_LOCALE=en_US.UTF-8
88

9-
LABEL name="Silverpeas 6" description="An all-to-one image to run Silverpeas 6 for testing purpose" vendor="Silverpeas" version=${SILVERPEAS_VERSION} build=1
9+
LABEL name="Silverpeas 6" description="An all-to-one image to run Silverpeas 6 for testing purpose" vendor="Silverpeas" version=${SILVERPEAS_VERSION} build=2
1010

1111
#
1212
# Check Silvereas and Wildfly at the asked version exist

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To create an image of the latest version of Silverpeas 6:
1414
```
1515
$ ./build.sh
1616
```
17-
this will build an image containing the latest SNAPSHOT version of Silverpeas and the latest version of Wildfly supported by Silverpeas, with the tag silverpeas-test:latest.
17+
this will build an image containing the latest SNAPSHOT version of Silverpeas and the latest version of Wildfly supported by Silverpeas, with the tag `silverpeas/silverpeas-test:latest`.
1818

1919
Otherwise, to create an image of a given version of Silverpeas 6, you have to specify as argument both the exact version of Silverpeas and of Wildfly used by this version:
2020
```
@@ -30,17 +30,23 @@ $ docker run --name silverpeas-test -p 8080:8000 -d silverpeas/silverpeas-test
3030
```
3131
The image exposes the 8000 port at which Silverpeas listens, and this port of the container is mapped to the 8080 port of the host.
3232

33-
When the container is instanciated from the image, a configuration step is performed before starting Silverpeas.
33+
When the container is spawn from the image, a configuration step is performed before starting Silverpeas.
3434
If you have no custom configurations to apply before running Silverpeas, you can avoid this step by starting directly Silverpeas:
3535
```
3636
$ docker run --name silverpeas-test -p 8080:8000 -d silverpeas/silverpeas-test start
3737
```
3838

39+
By default, the locale in Silverpeas is in French. To have instead the locale in English:
40+
```
41+
$ docker run --name silverpeas-test -p 8080:8000 -d -e locale=en silverpeas/silverpeas-test
42+
```
43+
this will configure Silverpeas by settings its default locale to English.
44+
3945
### Keep data out of the container
4046

4147
By default, the data are stored into the container and then they can be lost once the container removed.
4248
To share the data with others containers running Silverpeas or to keep them out of a container, you can mount the volumes `/opt/silverpeas/data` and `/opt/silverpeas/h2` on the host.
43-
You can also mount the volume `/opt/silverpeas/log` in order to glance at the Silverpeas activity through the logs files.
49+
You can also mount the volume `/opt/silverpeas/log` in order to glance at the logs.
4450
For example:
4551
```
4652
$ docker run --name silverpeas-test -p 8080:8000 -d \
@@ -52,9 +58,12 @@ $ docker run --name silverpeas-test -p 8080:8000 -d \
5258

5359
### Custom configuration
5460

55-
In the case you whish to set some specific configuration parameters in the global Silverpeas configuration file `config.properties`, set them into a `custom_config.properties` configuration file and then mount it as `/opt/silverpeas/configuration/custom_config.properties` in the container.
56-
For example, to set the SMTP properties to receive notifications by email, in a `custom_config.properties` file:
61+
In the case you wish to set some specific configuration parameters in the global Silverpeas configuration file `config.properties`, set them into a `custom_config.properties` configuration file on the host and then mount it as `/opt/silverpeas/configuration/custom_config.properties` in the container.
62+
For example, to set the SMTP properties to receive email notifications, in a `custom_config.properties` file:
5763
```
64+
SILVERPEAS_USER_LANGUAGE=en
65+
SILVERPEAS_CONTENT_LANGUAGES=en fr
66+
5867
SMTP_SERVER=smtp.googlemail.com
5968
SMTP_AUTHENTICATION=true
6069
SMTP_DEBUG=false

src/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
configure_silverpeas() {
99
echo "Generate ${SILVERPEAS_HOME}/configuration/config.properties..."
1010
cp ${SILVERPEAS_HOME}/configuration/db_config.properties ${SILVERPEAS_HOME}/configuration/config.properties
11+
if [ "Z${locale}" != "Z" ]; then
12+
echo "SILVERPEAS_USER_LANGUAGE=${locale}" >> ${SILVERPEAS_HOME}/configuration/config.properties
13+
echo "SILVERPEAS_CONTENT_LANGUAGES=${locale}" >> ${SILVERPEAS_HOME}/configuration/config.properties
14+
fi
1115
if [ -f ${SILVERPEAS_HOME}/configuration/custom_config.properties ]; then
1216
sed -ie "s/DB_.*$//g" /configuration/custom_config.properties
1317
cat ${SILVERPEAS_HOME}/configuration/custom_config.properties >> ${SILVERPEAS_HOME}/configuration/config.properties

0 commit comments

Comments
 (0)