Sign inSign up

metikular/coupon-store

By metikular

•Updated over 1 year ago

A home for all your coupons and loyalty cards. https://github.com/metikular/coupon-store

Image
0

50K+

metikular/coupon-store repository overview

A home for all your coupons and loyalty cards. Self-hostable and open-source, cf. https://github.com/metikular/coupon-store⁠.

⁠Requirements

You need either a PostgreSQL database alongside this image or use an embedded SQLite database.

⁠docker-compose

⁠Using PostgreSQL

Use the following docker-compose.yml as a starting point. You should at least change SECRET_PASSWORD and SECRET_KEY_BASE. For example, use openssl rand -hex 32 to generate them.

version: '3.9'
services:
  web:
    image: metikular/coupon-store
    command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 80 -b '0.0.0.0'"
    depends_on:
      - db
    environment:
      - DATABASE_URL=postgres://coupon_store:SECRET_PASSWORD@db/coupon_store
      - SECRET_KEY_BASE=change-me
    hostname: web
    restart: unless-stopped

  db:
    image: postgres:14
    restart: unless-stopped
    environment:
      - POSTGRES_USER=coupon_store
      - POSTGRES_PASSWORD=SECRET_PASSWORD
    volumes:
      - coupon-store-database:/var/lib/postgresql/data

volumes:
  coupon-store-database:
⁠Using SQLite

The advantage of using SQLite is that there is no need for a second container running a dedicated database. Use the following docker-compose.yml as a starting point:

version: '3.9'
services:
  web:
    image: metikular/coupon-store
    command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 80 -b '0.0.0.0'"
    environment:
      - DATABASE_URL=sqlite3:db/data/coupons.sqlite3
      - SECRET_KEY_BASE=change-me
    hostname: web
    restart: unless-stopped
    volumes:
      - coupon-store-database:/app/db/data

volumes:
  coupon-store-database:

⁠docker

If you already have a PostgreSQL database running and have created a database user therein, use the following to start it:

docker run --name coupon-store -e DATABASE_URL=postgres://coupon_store:SECRET_PASSWORD@db/coupon_store -e SECRET_KEY_BASE=change-me metikular/coupon-store
⁠Using SQLite
docker run --name coupon-store -e DATABASE_URL=sqlite3:db/data/coupons.sqlite3 -e SECRET_KEY_BASE=change-me metikular/coupon-store

Tag summary

Content type

Image

Digest

sha256:a4c56ce47…

Size

552 MB

Last updated

over 1 year ago

docker pull metikular/coupon-store