Git Product home page Git Product logo

lobsters-docker's Introduction

Docker build status Docker Pulls Docker Stars

Lobsters in a Docker container

This repo is designed to automatically build an image of Lobsters to use it in a production environmment on Docker.

Environment variables

Database

  • -e DATABASE_URL Defaults to "mysql2://root:password@lobsters-db/lobsters".

Where mysql2 is the adapter, root is the username, password is the password, lobsters-db is the host, and lobsters the name of database.

In this example, lobsters-db should be the name of the mysql container.

More informations: https://edgeguides.rubyonrails.org/configuring.html#configuring-a-database

Application

  • -e APP_DOMAIN Defaults to "example.com". This should be your domain name.
  • -e APP_NAME Defaults to "Example News". This should be your application name.
  • -e SECRET_KEY_BASE Defaults to "". If empty a generic key will be generated.
  • -e X_SENDFILE_HEADER Defaults to "". Specifies the header that your server uses for sending files.
  • -e RAILS_SERVE_STATIC_FILES Defaults to "true". If present then Puma will serve static asset.

Email

  • -e SMTP_HOST Defaults to "127.0.0.1".
  • -e SMTP_PORT Defaults to "25".
  • -e SMTP_STARTTLS_AUTO Defaults to "true".
  • -e SMTP_USERNAME Defaults to "".
  • -e SMTP_PASSWORD Defaults to "".

Starting the containers

Change or add the environmment variables to suit your needs, then run:

# Starting the mysql container
$ docker run --name lobsters-db -v /my/own/datadir:/var/lib/mysql -e "MYSQL_ROOT_PASSWORD=password" -e "MYSQL_DATABASE=lobsters" -d mysql:5.7

# Starting the lobsters container
$ docker run --name lobsters --link lobsters-db -p 3000:3000 -d guillaumebriday/lobsters-docker

You can use this docker-compose for this project:

$ docker-compose up -d

Administration

In lobsters, as mentioned in the documentation:

Basic moderation happens on-site, but most other administrative tasks require use of the rails console in production.

To open a console in production:

$ docker run --rm -it --link lobsters-db guillaumebriday/lobsters-docker bundle exec rails c

# Or with docker-compose
$ docker-compose run --rm lobsters bundle exec rails c

Credits

Inspired by:

Contributing

Do not hesitate to contribute to the project by adapting or adding features ! Bug reports or pull requests are welcome.

License

This project is released under the MIT license.

lobsters-docker's People

Contributors

guillaumebriday avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lobsters-docker's Issues

DB configuration issue

Hello,

I've tried your docker image at it seems more fit than the one you are based on (auto provisioning mostly).

It seems that there is an issue, as i have this in my logs
Mysql2::Error::ConnectionError: Access denied for user 'root'@'172.22.0.3' (using password: YES)

Even though i have setup the env variable
DB_USER=lobsters

I've seen no root hardcoded in your code, no idea what the issue is. FYI i do not have this issue with utensils version.

Thanks for you work on this container ๐Ÿ‘

APP_NAME appears to be ignored

-e APP_NAME Defaults to "Fullstack News". This should be your application name.

When I boot up the app with docker-compose up, I still am seeing "Example News" instead of my site name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.