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

Documentation on building/running Docker container #91

Open
obbardc opened this issue Mar 18, 2021 · 25 comments
Open

Documentation on building/running Docker container #91

obbardc opened this issue Mar 18, 2021 · 25 comments
Labels
Documentation Improvements or additions to documentation Good First Issue Good for newcomers

Comments

@obbardc
Copy link

obbardc commented Mar 18, 2021

There should be some information on how to build and run the Docker container in the README.

@obbardc obbardc added the Bug Something isn't working label Mar 18, 2021
@it33 it33 added Documentation Improvements or additions to documentation Good First Issue Good for newcomers and removed Bug Something isn't working labels Mar 18, 2021
@dustin-hawkins
Copy link

dustin-hawkins commented Mar 18, 2021

simple instructions

git clone https://github.com/mattermost/focalboard.git
docker build . --tag mattermost/focalboard
docker run -p 8000:8000 --restart always mattermost/focalboard

Now that a Dockerfile has been created, if whomever controlled the mattermost docker hub account could

docker build . --tag mattermost/focalboard
docker login
docker push mattermost/focalboard

the most simple docker-compose.yml file would then look like

version: '3.3'
services:
    focalboard:
        ports:
            - '80:8000'
        restart: always
        image: mattermost/focalboard

That being said, here is a docker-compose.yml that will build the existing image.

version: '3.3'
services:
    focalboard:
        ports:
            - '8000:8000'
        restart: always
        image: mattermost/focalboard
        build: .

@jespino
Copy link
Contributor

jespino commented Mar 18, 2021

@metanerd can you take care of this? How can we automatize that process? something like "as part of the release".

@dustin-hawkins
Copy link

dustin-hawkins commented Mar 18, 2021

@metanerd can you take care of this? How can we automatize that process? something like "as part of the release".

https://hub.docker.com/repository/create

Link it to your repository here, and then you can configure automatic builds & tags on commits to master or releases

@jespino
Copy link
Contributor

jespino commented Mar 18, 2021

@jwilander are you the person to contact for this?

@jwilander
Copy link
Contributor

Yep. I can make the dockerhub repo right now. As for getting the automation configured someone should be able to submit a circleci configuration for it. @metanerd or myself can configure the secrets in circleci for dockerhub for it but we've got a bunch of other high priority stuff we're working on right now so if you need more than that we'll need a JIRA ticket and to prioritize accordingly.

@jwilander
Copy link
Contributor

jwilander commented Mar 18, 2021

Actually looks like I can hook it directly up to dockerhub for auto-building per what @dustin-hawkins said. Let me just do that.

@jwilander
Copy link
Contributor

jwilander commented Mar 18, 2021

It's now set up here https://hub.docker.com/r/mattermost/focalboard. New pushes to master will get built as mattermost/focalboard:latest and new tags should be built as mattermost/focalboard:X.X.X

@obbardc
Copy link
Author

obbardc commented Mar 18, 2021

nice!

@jespino
Copy link
Contributor

jespino commented Mar 18, 2021

@jwilander Thanks!

@nicoulaj
Copy link

For what it's worth, I have setup a build for ARM images for deploying on raspberry pi, available at Dockerhub: nicoulaj/focalboard. The source is at: nicoulaj/focalboard-docker. I plan on maintaining it until ARM images are published by this project.

@proffalken
Copy link
Contributor

Do we need to be concerned about the API limits on Dockerhub?

Learn More
On November 20, 2020, rate limits anonymous and free authenticated use of Docker Hub went into effect. Anonymous and Free Docker Hub users are limited to 100 and 200 container image pull requests per six hours. You can read here for more detailed information.

If you are affected by these changes you will receive this error message:

ERROR: toomanyrequests: Too Many Requests.

OR

You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limits. You must authenticate your pull requests.
To increase your pull rate limits you can upgrade your account to a Docker Pro or Team subscription.

The rate limits of 100 container image requests per six hours for anonymous usage, and 200 container image requests per six hours for free Docker accounts are now in effect. Image requests exceeding these limits will be denied until the six hour window elapses.

NOTE: Docker Pro and Docker Team accounts enable 50,000 pulls in a 24 hour period from Docker Hub.  

I've no idea what the current rate of pulls is for this container, but if it takes off then we could easily surpass those limits I guess. Perhaps one to keep in mind for the future if nothing else?

@jwilander
Copy link
Contributor

Mattermost has a paid DockerHub account so there will be no limits for how many pulls can be made from mattermost/focalboard on our side. From what I understand, if you're unauthenticated making the request to pull the image you could be hit by the rate limit if you're trying to pull the image 100 times within a six hour window. Not sure why you'd need to do that, though. Even if you did hit that limit it won't stop someone else from pulling it, just you.

@proffalken
Copy link
Contributor

Not sure why you'd need to do that, though. Even if you did hit that limit it won't stop someone else from pulling it, just you.

Probably not so much an issue for this particular project, but I've got a client who builds containers from stuff on DockerHub via CI/CD and they've been hitting the 100 pull limit frequently of late. We're now in the process of setting up a local mirror for that container to work around this!

Good to know it won't be an issue for Focalboard though!

@fjorgemota
Copy link

@jwilander I'm not sure what exactly happened, but there's no tags available to download for the docker image you specified at Docker hub: https://hub.docker.com/r/mattermost/focalboard/tags?page=1&ordering=last_updated

Only the tag latest is available.

Could you take a look at that, if possible, please?

Thanks

@jwilander
Copy link
Contributor

@fjorgemota that's because the Dockerfile didn't exist when the tags were created so those older versions of the repo don't have it and dockerhub won't build it

@chenilim / @jespino thoughts about tagging again so there's a tagged docker image?

@fjorgemota
Copy link

Ahhh, fair enough.

Thanks for the fast answer! And sorry for bothering with such a simple question. =)

@olragon
Copy link

olragon commented May 4, 2021

Focalboard's Caprover One-Click-Apps also added caprover/one-click-apps/pull/414

@chenilim
Copy link
Contributor

chenilim commented May 4, 2021

Just trying to clean up old issues. @jespino, are there any follow up actions required on this one? Thanks.

@dl-lim
Copy link

dl-lim commented Jun 27, 2021

simple instructions

What is the volume to be exposed for persistence? Also, a docker-compose.yml example with supported databases would be handy too.

@charlesbido
Copy link

charlesbido commented Jul 11, 2021

Any volume we can use for persistence? Would like to make sure data is persisted after any restarts 🤷 Could hunt to see what kind of persistence myself, but it should be called out for sure.

Edit:

Looks like there is a nice docker-compose file (docker-compose-db-nginx.yml), which I'm happy exists, and it looks like it was included in docker/README.md

Docker Hub, however, doesn't have this information and it would be good to have it there as well 👍

@datafj
Copy link

datafj commented Dec 14, 2021

None of the two docker compose files in (https://github.com/mattermost/focalboard/tree/main/docker) uses SQLite. I'd like to mount a SQLite db file (from my home folder to the container) through the "volumes" command, where should be the targeted location? Thanks!

@Genei180
Copy link
Contributor

Genei180 commented Dec 14, 2021

@datafj There are currently Duplicate Instructions on how to use/build it with Docker.
One in the Main README and one in docker/README.

I suppose what you are looking for is in docker/README:
docker run -it -v "/home/user/focalboard-data:/data" -p 80:8000 focalboard
(I didn't test it, so please be careful)

Where "/home/user/focalboard-data" is the Path in your Host System.

Be Aware that you currently can't access the Config that Way. I am currently trying Possibilities to add that too.
After that I will remove the Original Instructions from the Main README and include a Reference in the Main README to the docker/README where I will add/update Instructions Accordingly.

@btxtiger
Copy link

btxtiger commented Sep 26, 2023

https://www.focalboard.com/download/personal-edition/docker/

Why isn't there any mention about persistent storage??
What are the relevant paths inside the image?

@Genei180
Copy link
Contributor

@btxtiger its doubled Information,
The Docker Folder has its own Readme Instructions:
https://github.com/mattermost/focalboard/tree/main/docker.

There, the Path to Relevant Data inside the Container is given:
"/opt/focalboard/data"

There is some trouble Providing the Config at Startup:
See the Pull Request #1891 for a further Discussion of Editing the Config File, as it is unfortunately not that Trivial.

@btxtiger
Copy link

I experimented a bit, creating a reliable docker setup. This is my solution so far, hope it helps. Feel free to use it in the docs.

Create a new project dir, e.g. focalboard.
focalboard/focalboard-config.json
The config.json must be created and available with the object, before you start the containers.

{
   "serverRoot": "http://localhost:8000",
   "port": 8000,
   "dbtype": "postgres",
   "dbconfig": "postgres://focalboard:my_db_password@db/focalboard_docker?sslmode=disable&connect_timeout=10",
   "postgres_dbconfig": "dbname=focalboard sslmode=disable",
   "useSSL": false,
   "webpath": "./pack",
   "filespath": "./data/files",
   "telemetry": false,
   "session_expire_time": 2592000,
   "session_refresh_time": 18000,
   "localOnly": false,
   "enableLocalMode": true,
   "localModeSocketLocation": "/var/tmp/focalboard_local.socket"
}

focalboard/docker-compose.yaml

version: "3"

networks:
    app_group:
        external: false

volumes:
    data_volume:
        driver: local
    db_volume:
        driver: local

services:
    fb:
        container_name: focalboard_app
        image: mattermost/focalboard
        volumes:
            - data_volume:/opt/focalboard/data
            - ./focalboard-config.json:/opt/focalboard/config.json:rw
        ports:
            - 9991:8000
        restart: unless-stopped
        networks:
            - app_group
        depends_on:
            - db

    db:
        container_name: focalboard_db
        image: postgres:15-alpine
        environment:
            POSTGRES_PASSWORD: my_db_password
            POSTGRES_USER: focalboard
            POSTGRES_DB: focalboard_docker
        volumes:
          - db_volume:/var/lib/postgresql/data
        restart: unless-stopped
        networks:
            - app_group

Finally run docker compose up etc..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation Good First Issue Good for newcomers
Projects
None yet
Development

No branches or pull requests