Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker #2423

Merged
merged 3 commits into from
Jul 27, 2022
Merged

Docker #2423

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Dockerfile
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
40 changes: 40 additions & 0 deletions aapb
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