diff --git a/README.md b/README.md index b88fe3327..41a3807eb 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![CircleCI](https://circleci.com/gh/stringer-rss/stringer/tree/main.svg?style=svg)](https://circleci.com/gh/stringer-rss/stringer/tree/main) [![Code Climate](https://api.codeclimate.com/v1/badges/899c5407c870e541af4e/maintainability)](https://codeclimate.com/github/stringer-rss/stringer/maintainability) [![Coverage Status](https://coveralls.io/repos/github/stringer-rss/stringer/badge.svg?branch=main)](https://coveralls.io/github/stringer-rss/stringer?branch=main) +![Docker Pulls](https://img.shields.io/docker/pulls/mockdeep/stringer?label=Docker%20Pulls) [![GitHub Sponsors](https://img.shields.io/github/sponsors/mockdeep?logo=github)](https://github.com/sponsors/mockdeep) ### A self-hosted, anti-social RSS reader. @@ -24,7 +25,7 @@ Stringer is a Ruby app based on Rails, PostgreSQL, Backbone.js and GoodJob. Stringer will run just fine on the Eco/Basic Heroku plans. Instructions are provided for deploying to [Heroku manually](/docs/Heroku.md), to any Ruby -compatible [Linux-based VPS](/docs/VPS.md), to [Docker](docs/docker.md) and to [OpenShift](/docs/OpenShift.md). +compatible [Linux-based VPS](/docs/VPS.md), to [Docker](docs/Docker.md) and to [OpenShift](/docs/OpenShift.md). ## Niceties diff --git a/docker-compose.yml b/docker-compose.yml index e378d7fc0..e78f8559f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,27 +1,40 @@ -version: '2' +version: '3.8' + services: postgres: - image: postgres:9.5-alpine + image: postgres:15-alpine + hostname: stringer-postgres restart: always + networks: + - stringer volumes: - - ~/stringer:/var/lib/postgresql/data + - ~/stringer/postgres:/var/lib/postgresql/data environment: - - POSTGRES_PASSWORD=super_secret_password + - POSTGRES_PASSWORD= - POSTGRES_USER=db_user - POSTGRES_DB=stringer web: - image: mockdeep/stringer + image: mockdeep/stringer:latest build: . depends_on: - postgres restart: always ports: - - 80:8080 + - '8080:8080' + networks: + - stringer-network environment: - SECRET_KEY_BASE= - ENCRYPTION_PRIMARY_KEY - ENCRYPTION_DETERMINISTIC_KEY= - ENCRYPTION_KEY_DERIVATION_SALT= + # - FETCH_FEEDS_CRON="*/5 * * * *" # optional + # - CLEANUP_CRON="0 0 * * *" # optional - PORT=8080 - - DATABASE_URL=postgres://db_user:super_secret_password@postgres:5432/stringer + - DATABASE_URL=postgres://db_user:@stringer-postgres:5432/stringer + +networks: + stringer: + external: false + name: stringer \ No newline at end of file diff --git a/docs/docker.md b/docs/Docker.md similarity index 89% rename from docs/docker.md rename to docs/Docker.md index 105da3ebf..5ee94ac9a 100644 --- a/docs/docker.md +++ b/docs/Docker.md @@ -2,7 +2,7 @@ ## Production ready setup using docker-compose -Download [docker-compose.yml](../docker-compose.yml) and in the corresponding folder, run `docker-compose up -d`, give it a second and visit `localhost` +Download [docker-compose.yml](../docker-compose.yml) and in the corresponding folder, run `docker-compose up -d`, give it a second and visit `localhost:8080` ## Production ready manual setup @@ -10,9 +10,9 @@ The following steps can be used to setup Stringer on Docker, using a Postgres da 1. Setup a Docker network so the two containers we're going to create can communicate: - ```Sh - docker network create --driver bridge stringer - ``` +```Sh +docker network create --driver bridge stringer +``` 2. Setup a Postgres Docker container: @@ -20,11 +20,12 @@ The following steps can be used to setup Stringer on Docker, using a Postgres da docker run --detach \ --name stringer-postgres \ --restart always \ - --volume /srv/stringer/data:/var/lib/postgresql/data \ + --volume ~/stringer:/var/lib/postgresql/data \ --net stringer \ - -e POSTGRES_PASSWORD=myPassword \ + -e POSTGRES_PASSWORD= \ + -e POSTGRES_USER=db_user \ -e POSTGRES_DB=stringer \ - postgres:9.5-alpine + postgres:12-alpine ``` 3. Run the Stringer Docker image: @@ -35,15 +36,15 @@ docker run --detach \ --net stringer \ --restart always \ -e PORT=8080 \ - -e DATABASE_URL=postgres://postgres:myPassword@stringer-postgres/stringer \ + -e DATABASE_URL=postgres://db_user:@stringer-postgres/stringer \ -e SECRET_KEY_BASE=$(openssl rand -hex 64) \ -e ENCRYPTION_PRIMARY_KEY=$(openssl rand -hex 64) \ -e ENCRYPTION_DETERMINISTIC_KEY=$(openssl rand -hex 64) \ -e ENCRYPTION_KEY_DERIVATION_SALT=$(openssl rand -hex 64) \ -e FETCH_FEEDS_CRON="*/5 * * * *" \ # optional -e CLEANUP_CRON="0 0 * * *" \ # optional - -p 127.0.0.1:8080:8080 \ - stringer-rss/stringer + -p 8080:8080 \ + mockdeep/stringer:latest ``` That's it! You now have a fully working Stringer instance up and running!