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

Docker #138

Closed
rgarrigue opened this issue Nov 22, 2017 · 3 comments
Closed

Docker #138

rgarrigue opened this issue Nov 22, 2017 · 3 comments

Comments

@rgarrigue
Copy link

Hello

I gave a quick shot at activitywatch. Was a bit buggued by a port issue, I already had something running on port 5000 and couldn't find a conf file or a command switch to change this.

So I gave a shot at a container for activitywatch. That won't work since it requires some system stuff and got some Qt dependencies that won't go easily in a container. But maybe this could be useful to someone, so here's the Dockerfile

FROM ubuntu:bionic

ENV UID=8426
ENV GID=8426
ENV VERSION=0.7.1

# Requirements
RUN apt-get update \
    && apt-get upgrade -y \
    && apt-get install -y dumb-init curl unzip \
    && groupadd -g ${GID} aw \
    && useradd -g aw -u ${UID} -d /activitywatch -m aw \
    && apt-get autoremove -y \
    && apt-get clean all

USER aw:aw
WORKDIR /activitywatch

# Installation
RUN curl -L -o /tmp/activitywatch.zip https://github.com/ActivityWatch/activitywatch/releases/download/v${VERSION}/activitywatch-v${VERSION}-linux-$(uname -m).zip \
    && unzip /tmp/activitywatch.zip -d / \
    && chmod -x /activitywatch/*.so* \
    && rm /tmp/activitywatch.zip

ENTRYPOINT ["/usr/bin/dumb-init","--"]
CMD ["/activitywatch/aw-qt"]

EXPOSE 80

and here's a docker-compose.yml

version: "3"

services:
  activitywatch:
    build: .
    ports:
      - 80:80
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
@ErikBjare
Copy link
Member

You don't need to run aw-qt if you don't want the trayicon/service manager functionality it provides. You should try to run aw-server directly instead.

Also, aw-server should accept a --port argument, so you could try that. Not sure if the watchers accept it but you could check and see :)

Anyway, fun to see you experimenting with ActivityWatch in Docker! Although I'm guessing it won't work very well until we open up the server to nonlocal connections.

@johan-bjareholt
Copy link
Member

johan-bjareholt commented Nov 22, 2017

Also, aw-server should accept a --port argument, so you could try that. Not sure if the watchers accept it but you could check and see :)

You can change the port on all of your local clients in the aw-client config file (in linux it is for example located at ~/.config/activitywatch/aw-client/aw-client.ini)

You can actually also change the default port of aw-server aswell in its config file if you don't want to pass the --port argument (located at a similar location, ~/.config/activitywatch/aw-server/aw-server.ini)

I don't believe this is documented anywhere though, we should probably do that

  • Document where all config files are located and what properties can be changed there

@ErikBjare
Copy link
Member

Created #141 as a documentation issue, closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants