Skip to content

Latest commit

 

History

History
82 lines (52 loc) · 2.26 KB

README.md

File metadata and controls

82 lines (52 loc) · 2.26 KB

Docker

Install Docker

Install Docker-Compose

You can run the application using the development image or production/deployment image.

Use Image

Make sure to supply the YOUTUBE_API_KEY in env/production.env

cp env/example.env env/production.env

You run the docker container using the docker-compose file in the root directory by using the following command.

docker-compose up -d

Go to http://localhost:8080/

How to build and use the image locally

The production image uses docker-compose with redis and postgres in separate containers.

To use the production image, please follow the steps below.

  1. Next you need to set up your configuration. Start by copying the example config in the env folder to a new file called production.env
cp env/example.env env/production.env
  1. Open env/production.env and replace API_KEY_GOES_HERE with the api keys.

  2. To build the image locally using the prod image make sure you are in the project root /opentogethertube before runing the command below.

docker-compose -f docker/docker-compose.yml --env-file env/production.env up -d
  1. After Go to http://localhost:8080/

Debug

You can open a shell inside of the container with the following command.

docker exec -it opentogethertube sh

You can also see the logs for the multiples containers with the following command.

docker-compose -f docker/docker-compose.yml logs

You can check for the status of the application and the other container in the docker-compose file with the following command.

docker-compose -f docker/docker-compose.yml ps

You also rebuild the docker image with the following command.

docker-compose -f docker/docker-compose.yml up -d --build

Developing for OTT using Docker

docker-compose-dev.yml is a special docker compose that is intended to assist in debugging bugs that only appear in production (which are usually bugs that occur when interacting with postgres instead of sqlite).

In order to use this setup, you must be able to run OTT outside of docker. After that, you can start it with:

docker-compose -f docker/docker-compose-dev.yml up --build