Skip to content

Commit

Permalink
add support for ocelot in docker-compose setup
Browse files Browse the repository at this point in the history
  • Loading branch information
itismadness committed Aug 20, 2021
1 parent 954b366 commit bec6976
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .docker/ocelot/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

echo "Waiting for mysql, sleeping for 20 seconds"
sleep 20

/srv/ocelot
39 changes: 39 additions & 0 deletions .docker/ocelot/ocelot.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Ocelot config file
# Lines starting with a # are ignored
# A # anywhere else is treated like any other character

listen_port = 34000
max_connections = 128
max_middlemen = 20000
max_read_buffer = 4096
connection_timeout = 10
# Keepalive is mostly useful if the tracker runs behind reverse proxies
keepalive_timeout = 0
enable_ipv6 = false

announce_interval = 1800
max_request_size = 4096
numwant_limit = 50
request_log_size = 500

mysql_host = mysql
mysql_username = gazelle
mysql_password = password
mysql_db = gazelle
# All queries are written to this file, if writable. Will be created if necessary.
mysql_query_dump =

# The passwords must be 32 characters and match the Gazelle config
report_password = 00000000000000000000000000000000
site_password = 00000000000000000000000000000000

peers_timeout = 7200
del_reason_lifetime = 86400
reap_peers_interval = 1800
schedule_interval = 3

log = false
log_queries = true
log_path = /tmp/ocelot

readonly = false
6 changes: 5 additions & 1 deletion .docker/web/generate-config.sed
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ s/('SPHINX(QL)?_HOST', *')(localhost|127\.0\.0\.1)/\1sphinxsearch/

s|('host' *=>) *'unix:///var/run/memcached.sock'(, *'port' *=>) *0|\1 'memcached'\2 11211|

s/('(DEBUG_MODE|DISABLE_TRACKER|DISABLE_IRC)',) *false/\1 true/
s/('(DEBUG_MODE|DISABLE_IRC)',) *false/\1 true/

s|'SOURCE', *'|&DEV|

s|'TRACKER_SECRET', *'|&00000000000000000000000000000000|
s|'TRACKER_REPORTKEY', *'|&00000000000000000000000000000000|
s/('TRACKER_HOST', *')localhost/\1ocelot/
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ needs. Gazelle is written in PHP, JavaScript, and MySQL.
* [Memcached](http://memcached.org/) (required)
* [Sphinx 2.0.6 or newer](http://sphinxsearch.com/) (required)
* [procps-ng](http://sourceforge.net/projects/procps-ng/) (recommended)

## Gazelle/Ocelot Compile-time Dependencies
* [Git](http://git-scm.com/) (required)
* [GCC/G++](http://gcc.gnu.org/) (4.7+ required; 4.8.1+ recommended)
* [Boost](http://www.boost.org/) (1.55.0+ required)
* ocelot

_Note: This list may not be exhaustive._

Expand All @@ -28,7 +24,18 @@ depedencies through `pip`:
Docker is used to develop Gazelle. See https://docs.docker.com/engine/install/
for more information on getting Docker set up locally.

`docker-compose up`
Setup the ocelot container, by cloning it and running:

```bash
docker build . -t ocelot
```

Within the gazelle folder, run the following command:


```bash
docker-compose up
```

This will build and pull the needed images to run Gazelle on Debian
Buster. A volume is mounted from the base of the git repository at
Expand Down
18 changes: 17 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ services:
build: .
ports:
- 8080:80
- 34000:34000
depends_on:
- memcached
- mysql
Expand Down Expand Up @@ -46,3 +45,20 @@ services:
# These should match what you set for your mysql container above
- MYSQL_USER=gazelle
- MYSQL_PASSWORD=password

ocelot:
image: ocelot
ports:
- 34000:34000
depends_on:
- mysql
volumes:
- ./.docker/ocelot/ocelot.conf:/srv/ocelot.conf
- ./.docker/ocelot/entrypoint.sh:/srv/entrypoint.sh
environment:
- DEVELOPMENT=true
- MYSQL_USER=gazelle
- MYSQL_PASSWORD=password
command:
- bash
- /srv/entrypoint.sh

0 comments on commit bec6976

Please sign in to comment.