Dockerize this project
Use a compose file so we can integrate a database and a jenkins server so we have a completely put together development environment
This commit is contained in:
Родитель
f23c1ed72a
Коммит
5d81765b01
|
@ -0,0 +1,25 @@
|
|||
FROM ruby:2.3
|
||||
|
||||
RUN touch /etc/app-env
|
||||
|
||||
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list
|
||||
|
||||
RUN apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 5072E1F5 && \
|
||||
echo "deb http://repo.mysql.com/apt/debian/ jessie mysql-5.7" > /etc/apt/sources.list.d/mysql.list && \
|
||||
apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs libmysqlclient-dev mysql-client
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY Gemfile /app
|
||||
COPY Rakefile /app
|
||||
COPY bin /app/bin
|
||||
COPY config.ru /app
|
||||
COPY janky.gemspec /app
|
||||
COPY lib /app/lib
|
||||
COPY script /app/script
|
||||
COPY test /app/test
|
||||
|
||||
RUN bundle install --binstubs
|
||||
RUN mkdir /app/log
|
||||
|
||||
EXPOSE 9393
|
|
@ -0,0 +1,32 @@
|
|||
version: '3.6'
|
||||
services:
|
||||
db:
|
||||
image: mysql:5.7
|
||||
command: --sql_mode="NO_ENGINE_SUBSTITUTION"
|
||||
environment:
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: 1
|
||||
volumes:
|
||||
- "db-data:/var/lib/mysql"
|
||||
jenkins:
|
||||
image: mattrdash/jenkins-for-janky:lts
|
||||
volumes:
|
||||
- "jenkins-data:/var/jenkins_home"
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
image: janky-app
|
||||
command: 'script/server'
|
||||
environment:
|
||||
- RACK_ENV
|
||||
- RACK_ROOT
|
||||
- JANKY_BASE_URL
|
||||
volumes:
|
||||
- "${VOLUME:-.:/app}"
|
||||
ports:
|
||||
- "9393:9393"
|
||||
depends_on:
|
||||
- db
|
||||
- jenkins
|
||||
volumes:
|
||||
db-data:
|
||||
jenkins-data:
|
|
@ -89,7 +89,7 @@ module Janky
|
|||
end
|
||||
|
||||
if env != "production"
|
||||
settings["DATABASE_URL"] ||= "mysql2://root@localhost/janky_#{env}"
|
||||
settings["DATABASE_URL"] ||= "mysql2://root@db/janky_#{env}"
|
||||
settings["JANKY_BASE_URL"] ||= "http://localhost:9393/"
|
||||
settings["JANKY_BUILDER_DEFAULT"] ||= "http://localhost:8080/"
|
||||
settings["JANKY_CONFIG_DIR"] ||= File.dirname(__FILE__)
|
||||
|
|
Загрузка…
Ссылка в новой задаче