Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Docker Config Volume #1891

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CHANGELOG.md
README.md

node_modules
.github/
mac/
win-wpf/
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ You can build standalone apps that package the server to run locally against SQL
* `docker build -f docker/Dockerfile .`
* To Build it for a custom Architekture (Expiremental)
* `docker build -f docker/Dockerfile --platform linux/arm64 .`
* For more information see: [Docker Readme](docker/README.md)

Cross-compilation currently isn't fully supported, so please build on the appropriate platform. Refer to the GitHub Actions workflows (build-mac.yml, build-win.yml, build-ubuntu.yml) for the detailed list of steps on each platform.

Expand Down
10 changes: 7 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ ADD . /go/src/focalboard

RUN make server-linux
RUN mkdir /data
RUN mkdir /config

## Final image
## Final Distrolles Base image
## For Debugging add :Debug see https://github.com/GoogleContainerTools/distroless#debug-images
FROM gcr.io/distroless/base-debian10

WORKDIR /opt/focalboard
Expand All @@ -25,14 +27,16 @@ COPY --from=gobuild --chown=nobody:nobody /data /data
COPY --from=nodebuild --chown=nobody:nobody /webapp/pack pack/
COPY --from=gobuild --chown=nobody:nobody /go/src/focalboard/bin/linux/focalboard-server bin/
COPY --from=gobuild --chown=nobody:nobody /go/src/focalboard/LICENSE.txt LICENSE.txt
COPY --from=gobuild --chown=nobody:nobody /go/src/focalboard/docker/server_config.json config.json
COPY --from=gobuild --chown=nobody:nobody /go/src/focalboard/docker/server_config.json /config/config.json

USER nobody

EXPOSE 8000/tcp

EXPOSE 8000/tcp 9092/tcp

VOLUME /config
VOLUME /data

CMD ["/opt/focalboard/bin/focalboard-server"]
ENTRYPOINT [ "/opt/focalboard/bin/focalboard-server"]
CMD ["--config", "/config/config.json"]
15 changes: 12 additions & 3 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@

The Dockerfile gives a quick and easy way to pull the latest Focalboard server and deploy it locally.

Execute from the Root Directory of this Repository to Build:
```
docker build -t focalboard .
docker run -it -v "/home/user/focalboard-data:/data" -p 80:8000 focalboard
docker build -f docker/Dockerfile -t focalboard .
```

> The `-v` flag can be used to store Focalboard's database and uploaded files in a directory on the Docker host
Execute for Running the Container
```
docker run -it -v "/home/user/focalboard-data:/data" \
-v "/home/user/focalboard-config:/config" \
-p 80:8000 focalboard
```

> The `-v` flag can be used to store Focalboard's config file and database and uploaded files in a directory on the Docker host
> When you use the Bind Mount for the Config Folder, be Aware that you need to Put a Valid Config File in the Specified Directory on the Host
> A Valid Config File can be found under: [Config File](server_config.json)

Open a browser to http://localhost to start

Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ services:
- 80:8000
environment:
- VIRTUAL_HOST=focalboard.local
- VIRTUAL_PORT=8000
- VIRTUAL_PORT=8000