-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
87 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.git | ||
.gitignore | ||
|
||
Dockerfile | ||
docker-compose.yml | ||
.dockerignore | ||
|
||
log/* | ||
tmp/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
POSTGRES_USER=abhinavnepal | ||
POSTGRES_PASSWORD=helloworld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM ruby:2.3.1 | ||
|
||
# install system libraries | ||
RUN apt-get update -yqq \ | ||
&& apt-get install -yqq build-essential libpq-dev nodejs qt5-default \ | ||
&& apt-get -q clean \ | ||
&& rm -rf /var/lib/apt/lists | ||
|
||
# install path setup | ||
ENV INSTALL_PATH /abhinav-nepal | ||
RUN mkdir -p $INSTALL_PATH | ||
|
||
# install gems | ||
COPY Gemfile* ./ | ||
RUN bundle install | ||
COPY . . | ||
|
||
CMD script/start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
default: &default | ||
adapter: postgresql | ||
encoding: unicode | ||
host: db | ||
username: <%= ENV["POSTGRES_USER"] %> | ||
password: <%= ENV["POSTGRES_PASSWORD"] %> | ||
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | ||
|
||
development: | ||
<<: *default | ||
encoding: unicode | ||
database: abhinav_dev | ||
pool: 5 | ||
host: localhost | ||
|
||
# Warning: The database defined as "test" will be erased and | ||
# re-generated from your development database when you run "rake". | ||
# Do not set this db to the same as development or production. | ||
test: | ||
<<: *default | ||
database: abhinav_test | ||
|
||
production: | ||
<<: *default | ||
host: <%= ENV["POSTGRES_HOST"] %> | ||
database: abhinav_prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: "2" | ||
|
||
services: | ||
db: | ||
image: postgres:9.6-alpine | ||
volumes: | ||
- db-data:/var/lib/postgresql/db-data | ||
ports: | ||
- "5432:5432" | ||
env_file: | ||
- .env | ||
app: | ||
build: . | ||
volumes: | ||
- .:/usr/src/app | ||
ports: | ||
- "3000:3000" | ||
depends_on: | ||
- db | ||
env_file: | ||
- .env | ||
|
||
volumes: | ||
db-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash -e | ||
|
||
if [[ -a /tmp/puma.pid ]]; then | ||
rm /tmp/puma.pid | ||
fi | ||
|
||
if [[ $RAILS_ENV == "production" ]]; then | ||
rake assets:precompile | ||
rake db:migrate | ||
mkdir -p /usr/share/nginx/html | ||
cp -R public/* /usr/share/nginx/html | ||
mkdir -p /etc/nginx/conf.d/ | ||
cp site.conf /etc/nginx/conf.d/default.conf | ||
fi | ||
|
||
rails server -b 0.0.0.0 -P /tmp/puma.pid |