-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from dsc-umass/docker-refresh
Adding Docker-Compose
- Loading branch information
Showing
8 changed files
with
130 additions
and
4 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
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,2 @@ | ||
docker exec -it project-matching_postgres_1 | ||
# psql project_matching_development projectmatch projectmatchpass |
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,22 @@ | ||
version: "3" | ||
services: | ||
postgres: | ||
image: postgres | ||
environment: | ||
- POSTGRES_USER=projectmatch | ||
- POSTGRES_PASSWORD=projectmatchpass | ||
volumes: | ||
- ./db/postgres:/var/lib/postgresql/data | ||
rails: | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile | ||
depends_on: | ||
- postgres | ||
links: | ||
- postgres | ||
volumes: | ||
- ./:/usr/src/app | ||
ports: | ||
- "3000:3000" | ||
|
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,29 @@ | ||
FROM ruby:2.7.0 | ||
|
||
# Installs dependencies to run Rails on the ruby:2.7.0 image | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
nodejs \ | ||
postgresql-client | ||
|
||
# Configure the main working directory | ||
WORKDIR /usr/src/app | ||
|
||
# Copies the main application to run install dependencies and rake files | ||
COPY . . | ||
|
||
# Yarn installation | ||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | ||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | ||
|
||
RUN apt-get update && apt-get install -y yarn | ||
RUN yarn install | ||
|
||
# Installs gems listed in the Gemfile.lock & Package.json | ||
RUN bundle install | ||
|
||
# Exposes the 3000 port to access it outside of the image | ||
EXPOSE 3000 | ||
|
||
# Default command that runs when the container starts | ||
CMD ["bash", "docker/docker_set_up.sh"] |
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,4 @@ | ||
# Database Setup | ||
bundle exec rake db:create | ||
bundle exec rake db:schema:load | ||
|
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,3 @@ | ||
rm tmp/pids/server.pid | ||
yarn install --check-files | ||
bundle exec rails server -b 0.0.0.0 |
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 @@ | ||
docker-compose exec rails ${@:-/bin/bash} |