This commit is contained in:
Maciej Szlosarczyk 2018-06-15 11:02:27 +03:00
parent 157b383738
commit afa275c805
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
5 changed files with 2 additions and 92 deletions

View file

@ -1,23 +1,9 @@
FROM ruby:2.3
FROM internetee/ruby:2.3
MAINTAINER maciej.szlosarczyk@internet.ee
RUN apt-get update > /dev/null && apt-get install -y > /dev/null \
build-essential \
nodejs \
imagemagick \
postgresql-client
RUN apt-get install -y > /dev/null \
qt5-default \
libqt5webkit5-dev \
gstreamer1.0-plugins-base \
gstreamer1.0-tools \
qtdeclarative5-dev \
gstreamer1.0-x
RUN mkdir -p /opt/webapps/app/tmp/pids
WORKDIR /opt/webapps/app
COPY Gemfile Gemfile.lock ./
RUN gem install bundler && bundle install --jobs 20 --retry 5
EXPOSE 3000

View file

@ -1,33 +0,0 @@
version: "3.2"
services:
app:
tty: true
stdin_open: true
build:
context: .
dockerfile: Dockerfile
links:
- db
environment:
- APP_DBHOST=db
volumes:
- .:/opt/webapps/app
ports:
- "3000:3000"
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails server -p 3000 -b '0.0.0.0'"
web:
image: nginx
volumes:
- ./docker/nginx.template:/etc/nginx/conf.d/nginx.template
ports:
- "80:80"
links:
- app
environment:
APP: 'app'
command: /bin/bash -c "envsubst '$$APP' < /etc/nginx/conf.d/nginx.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
db:
image: postgres:9.4

View file

@ -1,6 +0,0 @@
# /bin/sh
docker-compose down
docker-compose build
docker-compose run app rake db:setup:all
docker-compose run app rake db:migrate
docker-compose run app rake dev:prime

View file

@ -1,8 +0,0 @@
# /bin/sh
docker-compose down
docker-compose build
# Setup test database
docker-compose run app rake db:setup:all test
# Finally run tests to check if everything is in order
docker-compose run app rspec

View file

@ -1,29 +0,0 @@
log_format le_json '{ "time": "$time_iso8601", '
'"remote_addr": "$remote_addr", '
'"remote_user": "$remote_user", '
'"body_bytes_sent": "$body_bytes_sent", '
'"request_time": "$request_time", '
'"status": "$status", '
'"request": "$request", '
'"request_method": "$request_method", '
'"http_referrer": "$http_referer", '
'"http_user_agent": "$http_user_agent" }';
upstream app {
server ${APP}:3000;
}
server {
listen 80;
access_log /var/log/nginx/access.log le_json;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app;
break;
}
}