-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added Dockerfile to run dev env * basic init script with build and dev * added ./aapb help documentation
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 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,14 @@ | ||
FROM ruby:2.4.4 | ||
WORKDIR /usr/src/app | ||
|
||
RUN apt update && apt install -y nodejs curl libcurl3 libcurl3-openssl-dev openjdk-8-jdk && apt-get clean | ||
|
||
COPY Gemfile Gemfile.lock ./ | ||
|
||
RUN bundle install | ||
|
||
# COPY . . | ||
|
||
EXPOSE 3000 | ||
|
||
CMD rake jetty:clean && rake jetty:config && rake jetty:start && bundle exec rake db:migrate RAILS_ENV=development && bundle exec rails s -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,40 @@ | ||
#!/bin/bash | ||
HELP="AAPB init script\n\n | ||
A basic CLI for managing AAPB \n\n | ||
USAGE:\n\n | ||
\t ./aapb COMMAND [args] \n\n | ||
COMMANDS:\n\n | ||
\t b | build \t build the docker image\n | ||
\t c | cmd \t run a bash command with the docker image\n | ||
\t d | dev \t start a development server\n | ||
\t h | help \t prints this help text\n | ||
" | ||
|
||
DEV_CMD="docker run -it -p 3000:3000 -v $(pwd):/usr/src/app/ aapb" | ||
|
||
if [ -z $1 ]; then | ||
echo -e $HELP | ||
|
||
elif [ $1 = "build" -o $1 = "b" ]; then | ||
shift | ||
docker build -t aapb . "$@" | ||
|
||
elif [ $1 = "cmd" -o $1 = "c" ]; then | ||
shift | ||
if [ -z $1 ]; then | ||
$DEV_CMD bash | ||
else $DEV_CMD "$@" | ||
fi | ||
|
||
elif [ $1 = "dev" -o $1 = "d" ]; then | ||
shift | ||
$DEV_CMD "$@" | ||
|
||
else echo -e $HELP | ||
|
||
fi |