Add Docker Compose file
This commit is contained in:
parent
6bbd39dc23
commit
6386ae6db9
|
@ -0,0 +1,27 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: ./docker/app
|
||||
depends_on:
|
||||
- db
|
||||
env_file:
|
||||
- "./docker/dev.env"
|
||||
volumes:
|
||||
- ./:/clarion
|
||||
environment:
|
||||
- BUNDLE_PATH=./vendor
|
||||
working_dir: "/clarion"
|
||||
command: "./docker/app/run.sh"
|
||||
ports:
|
||||
- 127.0.0.1:3000:3000
|
||||
db:
|
||||
image: postgres:11.9
|
||||
volumes:
|
||||
- clarion-db:/var/lib/postgresql/data
|
||||
env_file:
|
||||
- "./docker/dev.env"
|
||||
|
||||
volumes:
|
||||
clarion-db:
|
|
@ -0,0 +1,3 @@
|
|||
FROM ruby:2.6.5
|
||||
|
||||
RUN apt-get update && apt-get install -y postgresql-client
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Install dependencies
|
||||
bundle install
|
||||
|
||||
# DB migrations
|
||||
./bin/rails db:create
|
||||
./bin/rails db:migrate
|
||||
./bin/rails db:seed
|
||||
|
||||
# Remove leftover PID file from non-clean exit
|
||||
rm tmp/pids/server.pid
|
||||
./bin/rails server --binding=0.0.0.0
|
|
@ -0,0 +1,6 @@
|
|||
RAILS_ENV=development
|
||||
|
||||
POSTGRES_HOST=db
|
||||
POSTGRES_USER=clarion
|
||||
POSTGRES_PASSWORD=clarion
|
||||
POSTGRES_DB=clarion
|
Loading…
Reference in New Issue