Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request themarshallproject#136 from AlJohri/docker
Browse files Browse the repository at this point in the history
add docker-compose, improve docker setup
  • Loading branch information
GabeIsman authored Oct 31, 2017
2 parents 2f26640 + 3ee1bc6 commit 6f2c577
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 11 deletions.
31 changes: 24 additions & 7 deletions DOCKER.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# Running Klaxon with Docker

*This guide is a work in progress.*
## Development Quickstart

1. Run the following commands:

```
docker-compose up -d database
docker-compose build app
docker-compose run app rake db:create db:migrate
docker-compose run app rake users:create_admin
docker-compose up app
open http://localhost:3000
```

2. Enter '[email protected]' in the email window. It should redirect you to a page that says: "Email Sent".

3. In the console find where it says "Go to Dashboard ( ... )" and copy and paste the link into the browser.

4. You'll now be logged in. The page should say "Watch Your First Item".

## Expected environmental variables

Expand All @@ -20,10 +37,10 @@ If you would like to use [Amazon SES](https://aws.amazon.com/ses/) instead to se
DATABASE_URL=
SECRET_KEY_BASE=
ADMIN_EMAILS=
SMTP_PROVIDER=AMAZON_SES
AMAZON_SES_ADDRESS=
AMAZON_SES_USERNAME=
AMAZON_SES_PASSWORD=
AMAZON_SES_DOMAIN=
EMAIL_FROM_ADDRESS=
SMTP_PROVIDER=SES
SES_ADDRESS=
SES_USERNAME=
SES_PASSWORD=
SES_DOMAIN=
MAILER_FROM_ADDRESS=
```
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.3.0
FROM ruby:2.3.4

# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
Expand All @@ -12,8 +12,5 @@ RUN bundle install

COPY . /usr/src/app

ENV RACK_ENV "production"
ENV RAILS_ENV "production"

EXPOSE 3000
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]
2 changes: 2 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

config.action_mailer.delivery_method = :letter_opener

config.web_console.whiny_requests = false

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true

Expand Down
15 changes: 15 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '2.2'

services:

database:
image: "postgres:9.6"

app:
ports: ["3000:3000"]
environment:
RACK_ENV: "development"
RAILS_ENV: "development"
DATABASE_URL: "postgres://postgres@database/klaxon"
SECRET_KEY_BASE: "secret_key_base"
ADMIN_EMAILS: "[email protected]"
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '2.2'

services:

app:
build: .
environment:
RACK_ENV:
RAILS_ENV:
DATABASE_URL:
SECRET_KEY_BASE:
ADMIN_EMAILS:

# SENDGRID or SES
SMTP_PROVIDER:

# Sendgrid
SENDGRID_USERNAME:
SENDGRID_PASSWORD:

# SES
SES_ADDRESS:
SES_USERNAME:
SES_PASSWORD:
SES_DOMAIN:
SES_PORT:

MAILER_FROM_ADDRESS:

0 comments on commit 6f2c577

Please sign in to comment.