From fa759ae7b2840ec489ebb72011eccddb9dbc713e Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Mon, 1 Mar 2021 19:21:27 -0500 Subject: [PATCH] Add docker compose for deps --- .gitignore | 1 + docker/database.env.example | 3 +++ docker/docker-compose.yml | 22 ++++++++++++++++++++++ docker/redis/redis.conf | 2 ++ 4 files changed, 28 insertions(+) create mode 100644 docker/database.env.example create mode 100644 docker/docker-compose.yml create mode 100644 docker/redis/redis.conf diff --git a/.gitignore b/.gitignore index 7b3c05c..040d4e9 100644 --- a/.gitignore +++ b/.gitignore @@ -100,6 +100,7 @@ test/databases/private.db # Config files config.json +docker/database.env # Mac files .DS_Store diff --git a/docker/database.env.example b/docker/database.env.example new file mode 100644 index 0000000..dba3119 --- /dev/null +++ b/docker/database.env.example @@ -0,0 +1,3 @@ +POSTGRES_USER=sponsorblock +POSTGRES_PASSWORD= +POSTGRES_DB=sponsorTimes \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..224055a --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' +services: + database: + container_name: database + image: postgres + env_file: + - database.env + volumes: + - database-data:/var/lib/postgresql/data + ports: + - 5432:5432 + redis: + container_name: redis + image: redis + command: /usr/local/etc/redis/redis.conf + volumes: + - ./redis/redis.conf:/usr/local/etc/redis/redis.conf + ports: + - 32773:6379 + +volumes: + database-data: \ No newline at end of file diff --git a/docker/redis/redis.conf b/docker/redis/redis.conf new file mode 100644 index 0000000..023731b --- /dev/null +++ b/docker/redis/redis.conf @@ -0,0 +1,2 @@ +maxmemory-policy allkeys-lru +maxmemory 1000mb \ No newline at end of file