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 configuration #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@ $ chmod +x Gitify

Please see [the Installation wiki](https://github.com/modmore/Gitify/wiki/1.-Installation) for more details.

## Docker Usage

### Example usage:

```
docker build -t gitify docker
docker run --rm -v "src:/var/www/html" gitify help
```

### Example docker-compose configuration:

``` yaml
version: '3.1'

services:

[...]

gitify:
build: docker
volumes:
- "./src:/var/www/html"
```

Notice: gitify's container needs to be able to access the database and the sourcecode of ModX.

## Documentation

Expand Down
14 changes: 14 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM composer:1.7.2

RUN git clone https://github.com/modmore/Gitify.git /usr/local/lib/gitify && \
cd /usr/local/lib/gitify && \
composer install && \
ln -s /usr/local/lib/gitify/Gitify /usr/local/bin/Gitify && \
mkdir /gitify
RUN apk --no-cache add mysql-client
RUN docker-php-ext-install pdo_mysql

COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
VOLUME ["/var/www/html", "/gitify"]
WORKDIR /var/www/html
18 changes: 18 additions & 0 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
set -euo pipefail

if [ "$#" -ne 1 ]; then
set -- Gitify
fi

# first arg is a option
if [ "${1#-}" != "$1" ]; then
set -- Gitify "$@"
fi

# if our command is a valid gitify subcommand, let's invoke it through gitify instead
if Gitify help "$1" > /dev/null 2>&1; then
set -- Gitify "$@"
fi

exec "$@"