Setting up the Coral Project’s Talk product on AWS

This morning I spent some time kicking the tires on Coral Project’s Talk. Comments that don’t suck! If you’ve already got Ask running, you’ve got a headstart in AWS – just replicate the setup. Come back when you’ve got that done.

One issue I ran into at this point: The EC2 cluster hostname ended up in the Ubuntu sources file. Some more info in this thread. After I got that cleared up and updated apt, I installed docker.

Before we get the app running, we’ve got to get Redis and MongoDB started. I decided to use the official Docker containers and run them in the background.

docker run --name talk-redis -d redis && docker run --name talk-mongo -d mongo

Add your Ubuntu user to the docker group, restart the session with a reboot or logout/login, and then you can use the docker command in the Talk install readme. Playing around with that command for a bit, I settled on this as my startup command. I tried to go with an empty plugins object at first, but ran into some issues with the GraphQL responses, so that’s why I have the Facebook app ID/secret included too.

docker run --rm -p 5000:5000 \
-e TALK_INSTALL_LOCK=false \
-e TALK_JWT_SECRET=LOVETOCOMMENT \
-e TALK_MONGO_URL=mongodb://mongo/talk \
-e TALK_REDIS_URL=redis://redis \
-e TALK_ROOT_URL=https://talk.notphilly.com \
-e TALK_FACEBOOK_APP_ID=5554432162346234 \
-e TALK_FACEBOOK_APP_SECRET=ZUCKISCOOL \
--link talk-redis:redis \
--link talk-mongo:mongo \
coralproject/talk:latest

The --rm means that the container gets destroyed after it runs. I’m also not using the -D detached command so I see the Node feedback.

Due to the embed nature of Talk, SSL is highly recommended. Caddy handles all the SSL setup quite easily, here’s what my Caddy file looks like. The -p 5000:5000 above takes the port 5000 out of Docker container and makes it available in the server.

talk.notphilly.com
proxy / localhost:5000

Now, in a separate tab connected to my instance, I got the Talk docker container ID using docker ps and then ran docker exec -it {{container ID}} cli setup to launch myself into the interactive setup process.

After that, I was able to login at the /admin/configure address.

So now you might want to change TALK_INSTALL_LOCK to be true. I haven’t setup email or recaptcha yet, and the code above can probably be improved to make this run as a background with auto-restart. But that’s enough for now! Let me know what you think in the comments :).


Update: After noticing that there’s been a new release, I checked out the update procedure. All I did was stop the docker process, run docker pull coralproject/talk, and then use the command above again. That’s it! Cool.

Another update: Sometimes a database upgrade might be required. Here’s how I modified the Docker command to handle this.

docker run -it --rm -p 5000:5000 \
-e TALK_INSTALL_LOCK=true \
-e TALK_JWT_SECRET=LOVETOCOMMENT \
-e TALK_MONGO_URL=mongodb://mongo/talk \
-e TALK_REDIS_URL=redis://redis \
-e TALK_ROOT_URL=https://talk.notphilly.com \
-e TALK_FACEBOOK_APP_ID=5554432162346234 \
-e TALK_FACEBOOK_APP_SECRET=ZUCKISCOOL \
--link talk-redis:redis \
--link talk-mongo:mongo \
--entrypoint=/bin/bash \
coralproject/talk:latest \
-c "./bin/cli migration run"

And here’s the command I use to start the server again.

docker run -d --rm -p 5000:5000 \
-e TALK_INSTALL_LOCK=false \
-e TALK_JWT_SECRET=LOVETOCOMMENT \
-e TALK_MONGO_URL=mongodb://mongo/talk \
-e TALK_REDIS_URL=redis://redis \
-e TALK_ROOT_URL=https://talk.notphilly.com \
-e TALK_FACEBOOK_APP_ID=5554432162346234 \
-e TALK_FACEBOOK_APP_SECRET=ZUCKISCOOL \
--link talk-redis:redis \
--link talk-mongo:mongo \
coralproject/talk:latest

Posted May. 17 2017, 10:34 am by Davis