Skip to content

Commit

Permalink
switch back to using port 6060
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Mar 28, 2020
1 parent 09fe46f commit 23106c2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
10 changes: 5 additions & 5 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ All images are available at https://hub.docker.com/r/tinode/

1. **RethinkDB**:
```
$ docker run -p 6060:18080 -d --name tinode-srv --network tinode-net tinode/tinode-rethinkdb:latest
$ docker run -p 6060:6060 -d --name tinode-srv --network tinode-net tinode/tinode-rethinkdb:latest
```

2. **MySQL**:
```
$ docker run -p 6060:18080 -d --name tinode-srv --network tinode-net tinode/tinode-mysql:latest
$ docker run -p 6060:6060 -d --name tinode-srv --network tinode-net tinode/tinode-mysql:latest
```

3. **MongoDB**:
```
$ docker run -p 6060:18080 -d --name tinode-srv --network tinode-net tinode/tinode-mongodb:latest
$ docker run -p 6060:6060 -d --name tinode-srv --network tinode-net tinode/tinode-mongodb:latest
```

You can also run Tinode with the `tinode/tinode` image (which has all of the above DB adapters compiled in). You will need to specify the database adapter via `STORE_USE_ADAPTER` environment variable. E.g. for `mysql`, the command line will look like
Expand All @@ -76,7 +76,7 @@ All images are available at https://hub.docker.com/r/tinode/

The container comes with a built-in config file which can be customized with values from the environment variables (see [Supported environment variables](#supported_environment_variables) below). If changes are extensive it may be more convenient to replace the built-in config file with a custom one. In that case map the config file located on your host (e.g. `/users/jdoe/new_tinode.conf`) to container (e.g. `/tinode.conf`) using [Docker volumes](https://docs.docker.com/storage/volumes/) `--volume /users/jdoe/new_tinode.conf:/tinode.conf` then instruct the container to use the new config `--env EXT_CONFIG=/tinode.conf`:
```
$ docker run -p 6060:18080 -d --name tinode-srv --network tinode-net \
$ docker run -p 6060:6060 -d --name tinode-srv --network tinode-net \
--volume /users/jdoe/new_tinode.conf:/tinode.conf \
--env EXT_CONFIG=/tinode.conf \
tinode/tinode-mysql:latest
Expand Down Expand Up @@ -109,7 +109,7 @@ Project ID `myproject-1234`, App ID `1:141421356237:web:abc7de1234fab56cd78abc`,
is `83_Or_So_Random_Looking_Characters`, start the container with the following parameters (using MySQL container as an example):

```
$ docker run -p 6060:18080 -d --name tinode-srv --network tinode-net \
$ docker run -p 6060:6060 -d --name tinode-srv --network tinode-net \
-v /Users/jdoe:/fcm \
--env FCM_CRED_FILE=/fcm/myproject-1234-firebase-adminsdk-abc12-abcdef012345.json \
--env FCM_API_KEY=AIRaNdOmX4ULR-X6ranDomzZ2bHdRanDomq2tbQ \
Expand Down
16 changes: 8 additions & 8 deletions docker/docker-compose/cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ services:
# # Logs directory.
# - <path to your tinode-0 logs directory>:/var/log
ports:
- "6060:18080"
- "6060:6060"
environment:
<< : *tinode-env-vars
"CLUSTER_SELF": "tinode-0"
Expand All @@ -104,13 +104,13 @@ services:
# # Logs directory.
# - <path to your tinode-1 logs directory>:/var/log
ports:
- "6061:18080"
- "6061:6060"
environment:
<< : *tinode-env-vars
"CLUSTER_SELF": "tinode-1"
# Wait for tinode-0, not the database since
# we let tinode-0 perform all database initialization and upgrade work.
"WAIT_FOR": "tinode-0:18080"
"WAIT_FOR": "tinode-0:6060"
"NO_DB_INIT": "true"

tinode-2:
Expand All @@ -124,13 +124,13 @@ services:
# # Logs directory.
# - <path to your tinode-2 logs directory>:/var/log
ports:
- "6062:18080"
- "6062:6060"
environment:
<< : *tinode-env-vars
"CLUSTER_SELF": "tinode-2"
# Wait for tinode-0, not the database since
# we let tinode-0 perform all database initialization and upgrade work.
"WAIT_FOR": "tinode-0:18080"
"WAIT_FOR": "tinode-0:6060"
"NO_DB_INIT": "true"

# Monitoring.
Expand All @@ -148,7 +148,7 @@ services:
environment:
<< : *exporter-env-vars
"INSTANCE": "tinode-0"
"WAIT_FOR": "tinode-0:18080"
"WAIT_FOR": "tinode-0:6060"

exporter-1:
<< : *exporter-base
Expand All @@ -163,7 +163,7 @@ services:
environment:
<< : *exporter-env-vars
"INSTANCE": "tinode-1"
"WAIT_FOR": "tinode-1:18080"
"WAIT_FOR": "tinode-1:6060"

exporter-2:
<< : *exporter-base
Expand All @@ -178,4 +178,4 @@ services:
environment:
<< : *exporter-env-vars
"INSTANCE": "tinode-2"
"WAIT_FOR": "tinode-2:18080"
"WAIT_FOR": "tinode-2:6060"
15 changes: 8 additions & 7 deletions docker/tinode/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Docker file builds an image with a tinode chat server.
# The server exposes port 18080.
# In order to run the image you have to link it to a running RethinkDB container
# (assuming it's named 'rethinkdb') and map the port where the tinode server accepts connections:
#
# $ docker run -p 6060:18080 -d --link rethinkdb \
# In order to run the image you have to link it to a running database container. For example, to
# to use RethinkDB (named 'rethinkdb') and map the port where the tinode server accepts connections:
#
# $ docker run -p 6060:6060 -d --link rethinkdb \
# --env UID_ENCRYPTION_KEY=base64+encoded+16+bytes= \
# --env API_KEY_SALT=base64+encoded+32+bytes \
# --env AUTH_TOKEN_KEY=base64+encoded+32+bytes \
Expand All @@ -13,6 +13,7 @@ FROM alpine:latest

ARG VERSION=0.16
ENV VERSION=$VERSION
ARG BINVERS=$VERSION

LABEL maintainer="Tinode Team <info@tinode.co>"
LABEL name="TinodeChatServer"
Expand Down Expand Up @@ -112,7 +113,7 @@ COPY config.template .
COPY entrypoint.sh .

# Get the desired Tinode build.
ADD https://github.com/tinode/chat/releases/download/v$VERSION/tinode-$TARGET_DB.linux-amd64.tar.gz .
ADD https://github.com/tinode/chat/releases/download/v$BINVERS/tinode-$TARGET_DB.linux-amd64.tar.gz .

# Unpack the Tinode archive.
RUN tar -xzf tinode-$TARGET_DB.linux-amd64.tar.gz \
Expand All @@ -128,5 +129,5 @@ RUN chmod +x credentials.sh
# Generate config from template and run the server.
ENTRYPOINT ./entrypoint.sh

# HTTP and gRPC ports
EXPOSE 18080 16061
# HTTP, gRPC, cluster ports
EXPOSE 6060 16060 12000-12002
10 changes: 5 additions & 5 deletions docker/tinode/config.template
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"listen": ":18080",
"listen": ":6060",
"api_path": "/",
"cache_control": 39600,
"static_mount": "/",
"grpc_listen": ":16061",
"grpc_listen": ":16060",
"api_key_salt": "$API_KEY_SALT",
"max_message_size": 4194304,
"max_subscriber_count": 32,
Expand Down Expand Up @@ -145,9 +145,9 @@
"self": "",
"nodes": [
// Name and TCP address of each node.
{"name": "tinode-0", "addr": "tinode-0:12001"},
{"name": "tinode-1", "addr": "tinode-1:12002"},
{"name": "tinode-2", "addr": "tinode-2:12003"}
{"name": "tinode-0", "addr": "tinode-0:12000"},
{"name": "tinode-1", "addr": "tinode-1:12001"},
{"name": "tinode-2", "addr": "tinode-2:12002"}
],
"failover": {
"enabled": true,
Expand Down

0 comments on commit 23106c2

Please sign in to comment.