Merge pull request #226 from foobarto/master

fixes #225 - dockerized problem in the sidekiq-in-container
docker-smtp
Marcin Kulik 8 years ago committed by GitHub
commit 2f81171582

@ -86,7 +86,7 @@ RUN rbenv local $RUBY_VERSION && \
mkdir -p tmp && \ mkdir -p tmp && \
touch tmp/restart.txt touch tmp/restart.txt
VOLUME ["/app/config", "/app/log"] VOLUME ["/app/config", "/app/log", "/app/uploads"]
# 172.17.42.1 is the docker0 address # 172.17.42.1 is the docker0 address
ENV DATABASE_URL "postgresql://postgres:mypass@172.17.42.1/asciinema" ENV DATABASE_URL "postgresql://postgres:mypass@172.17.42.1/asciinema"
@ -95,7 +95,7 @@ ENV RAILS_ENV "development"
# when using Docker Toolbox/Virtualbox this is going to be your address # when using Docker Toolbox/Virtualbox this is going to be your address
# set to whatever FQDN/address you want asciinema to advertise itself as # set to whatever FQDN/address you want asciinema to advertise itself as
# for ex. asciinema.example.com # for ex. asciinema.example.com
ENV HOST "192.168.99.100:3000" ENV HOST "localhost:3000"
ENTRYPOINT ["rbenv", "exec"] ENTRYPOINT ["rbenv", "exec"]
CMD ["bundle", "exec", "rails", "server"] CMD ["bundle", "exec", "rails", "server"]

@ -21,16 +21,16 @@ Below you'll find setup instructions in case you want to contribute, play with
it on your local machine, or setup your own instance for private use or for it on your local machine, or setup your own instance for private use or for
your organization. your organization.
### Using Docker ### Quickstart Using Docker Compose
Required:
- [Docker](https://docs.docker.com/engine/getstarted/step_one/#step-1-get-docker)
- [docker-compose 1.5+](https://docs.docker.com/compose/install/)
```bash ```bash
$ docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=mypass --name=postgres postgres $ wget https://raw.githubusercontent.com/asciinema/asciinema.org/master/docker-compose.yml
$ docker run -d -p 6379:6379 --name=redis redis $ docker-compose up -d asciinema
$ docker run --rm --link postgres:postgres -e DATABASE_URL="postgresql://postgres:mypass@postgres/asciinema" --link redis:redis -e REDIS_URL="redis://redis:6379" asciinema/asciinema.org bundle exec rake db:setup $ docker-compose run --rm db_init
# starting sidekiq using the provided start_sidekiq.rb file will also start sendmail service if you don't want to use SMTP
# otherwise start sidekiq by starting: bundle exec sidekiq
$ docker run -d --link postgres:postgres -e DATABASE_URL="postgresql://postgres:mypass@postgres/asciinema" --link redis:redis -e REDIS_URL="redis://redis:6379" asciinema/asciinema.org ruby start_sidekiq.rb
$ docker run -d --link postgres:postgres -e DATABASE_URL="postgresql://postgres:mypass@postgres/asciinema" --link redis:redis -e REDIS_URL="redis://redis:6379" -p 3000:3000 asciinema/asciinema.org
``` ```
You can override the address/port that is sent in email with login token by passing HOST="host:port" environment variable when starting the web server. You can override the address/port that is sent in email with login token by passing HOST="host:port" environment variable when starting the web server.

@ -0,0 +1,55 @@
version: '2'
# Quickstart:
# docker-compose up -d asciinema
# docker-compose run --rm db_init
# To cleanup:
# docker-compose stop && docker-compose rm
services:
postgres:
image: postgres
container_name: postgres
redis:
image: redis
container_name: redis
sidekiq:
image: asciinema/asciinema.org
links:
- redis
- postgres
environment:
DATABASE_URL: "postgresql://postgres:mypass@postgres/asciinema"
REDIS_URL: "redis://redis:6379"
HOST: "localhost:3000"
command: "ruby start_sidekiq.rb"
volumes:
- /tmp/asciinema/uploads:/app/uploads
asciinema:
image: asciinema/asciinema.org
container_name: asciinema
links:
- redis
- postgres
depends_on:
- sidekiq
environment:
DATABASE_URL: "postgresql://postgres:mypass@postgres/asciinema"
REDIS_URL: "redis://redis:6379"
HOST: "localhost:3000" # replace with actual hostname/ip.... ${HOSTNAME} doesn't seem to work..
ports:
- "3000:3000"
volumes:
- /tmp/asciinema/uploads:/app/uploads
db_init:
image: asciinema/asciinema.org
links:
- redis
- postgres
environment:
DATABASE_URL: "postgresql://postgres:mypass@postgres/asciinema"
REDIS_URL: "redis://redis:6379"
command: "bundle exec rake db:setup"
Loading…
Cancel
Save