1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-11-24 08:22:29 +02:00

Add Docker volume persistence (#159)

* Add persistence to the default Docker container

This sets a default volume of `/data` for the Docker container.
This allows for persistence when using the default SQLite database, and the option of mounting the volume to the host for backing up.

* Add -v flag description

Co-authored-by: Jesús Espino <jespinog@gmail.com>
This commit is contained in:
Kassim 2021-06-07 10:20:32 +01:00 committed by GitHub
parent 98c6d4fbe4
commit 69df147723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 4 deletions

View File

@ -21,6 +21,8 @@ ARG PGID=2000
EXPOSE 8000/tcp
VOLUME /data
RUN addgroup -g ${PGID} focalboard && \
adduser -H -D -u ${PUID} -G focalboard focalboard
@ -29,7 +31,7 @@ WORKDIR /opt/focalboard
COPY --from=gobuild /go/focalboard/bin/linux/focalboard-server bin/
COPY --from=nodebuild /focalboard/webapp/pack pack/
COPY --from=nodebuild /focalboard/LICENSE.txt LICENSE.txt
COPY --from=nodebuild /focalboard/server-config.json config.json
COPY --from=nodebuild /focalboard/docker/server_config.json config.json
RUN chown -R ${PUID}:${PGID} /opt/focalboard

View File

@ -6,9 +6,11 @@ The Dockerfile gives a quick and easy way to pull the latest Focalboard server a
```
docker build -t focalboard .
docker run -it -p 80:8000 focalboard
docker run -it -v "/home/user/focalboard-data:/data" -p 80:8000 focalboard
```
> The `-v` flag can be used to store Focalboard's database and uploaded files in a directory on the Docker host
Open a browser to http://localhost to start
## Docker-Compose
@ -19,7 +21,7 @@ To start the server run
```
docker-compose up
```
```
This will automatically build the focalboard image and start it with the http port mapping.
@ -27,4 +29,4 @@ To run focalboard with a nginx proxy and a postgres backend run
```
docker-compose -f docker-compose-db-nginx.yml up
```
```

16
docker/server_config.json Normal file
View File

@ -0,0 +1,16 @@
{
"serverRoot": "http://localhost:8000",
"port": 8000,
"dbtype": "sqlite3",
"dbconfig": "/data/focalboard.db",
"postgres_dbconfig": "dbname=focalboard sslmode=disable",
"useSSL": false,
"webpath": "./pack",
"filespath": "/data/files",
"telemetry": true,
"session_expire_time": 2592000,
"session_refresh_time": 18000,
"localOnly": false,
"enableLocalMode": true,
"localModeSocketLocation": "/var/tmp/focalboard_local.socket"
}