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

add docker-compose #105

Merged
merged 10 commits into from
Mar 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ webapp/cypress/videos
server/swagger/clients
server/vendor
.idea
docker/certs
docker/data
6 changes: 3 additions & 3 deletions Dockerfile → docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:latest
FROM ubuntu:20.04

# Make sure that the underlying container is patched to the latest versions
RUN apt update && \
apt install -y wget tar gzip
RUN apt-get update && \
apt-get install -y gzip tar wget

# Now install Focalboard as a seperate layer
RUN wget https://github.com/mattermost/focalboard/releases/download/v0.6.1/focalboard-server-linux-amd64.tar.gz && \
Expand Down
30 changes: 30 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Deploy Focalboard with Docker

## Docker

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

```
docker build -t focalboard .
docker run -it -p 80:8000 focalboard
```

Open a browser to http://localhost to start

## Docker-Compose

Docker-Compose provides the option to automate the build and run step, or even include some of the steps from the [personal server setup](https://www.focalboard.com/download/personal-edition/ubuntu/).

To start the server run

```
docker-compose up
```

This will automatically build the focalboard image and start it with the http port mapping.

To run focalboard with a nginx proxy and a postgres backend run

```
docker-compose -f docker-compose-db-nginx.yml up
```
16 changes: 16 additions & 0 deletions docker/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"serverRoot": "http://localhost:8000",
"port": 8000,
"dbtype": "postgres",
"dbconfig": "postgres://boardsuser:boardsuser-password@focalboard-db/boards?sslmode=disable&connect_timeout=10",
"postgres_dbconfig": "dbname=boards sslmode=disable",
"useSSL": false,
"webpath": "./pack",
"filespath": "./files",
"telemetry": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: a bit of indentation problem here.

"session_expire_time": 2592000,
"session_refresh_time": 18000,
"localOnly": false,
"enableLocalMode": true,
"localModeSocketLocation": "/var/tmp/focalboard_local.socket"
}
36 changes: 36 additions & 0 deletions docker/docker-compose-db-nginx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: "3"
services:
app:
build:
context: ./
container_name: focalboard
depends_on:
- focalboard-db
expose:
- 8000
environment:
- VIRTUAL_HOST=focalboard.local
- VIRTUAL_PORT=8000
volumes:
- "./config.json:/opt/focalboard/config.json"

proxy:
image: jwilder/nginx-proxy:latest
container_name: focalboard-proxy
ports:
- 443:443
volumes:
- "./certs:/etc/nginx/certs:ro"
- "/var/run/docker.sock:/tmp/docker.sock:ro"

focalboard-db:
image: postgres:latest
container_name: focalboard-postgres
restart: always
volumes:
- "./data:/var/lib/postgresql/data"
environment:
POSTGRES_DB: boards
POSTGRES_USER: boardsuser
POSTGRES_PASSWORD: boardsuser-password

12 changes: 12 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3"
services:
app:
build:
context: ./
container_name: focalboard
ports:
- 80:8000
environment:
- VIRTUAL_HOST=focalboard.local
- VIRTUAL_PORT=8000