Skip to content

Commit

Permalink
Merge pull request #22 from Floppy/docker-build
Browse files Browse the repository at this point in the history
Fix docker build
  • Loading branch information
Floppy authored Feb 19, 2021
2 parents 5c465db + 4c15c58 commit 4611142
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
11 changes: 7 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/Dockerfile
/docker-compose.*
/.dockerignore
/.bundle
/db/*.sqlite3
/db/*.sqlite3-*
Expand All @@ -11,8 +14,8 @@
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
.env
/yarn-debug.log*
/.yarn-integrity
/.env
/config/credentials/*.key
.git
/.git
11 changes: 2 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.0-alpine
FROM ruby:3.0-alpine AS build

RUN apk add --no-cache tzdata alpine-sdk postgresql-dev nodejs yarn python2

Expand All @@ -16,21 +16,14 @@ RUN yarn install --prod
RUN gem install bundler -v 2.2.4
RUN bundle config set --local deployment 'true'
RUN bundle config set --local without 'development test'
COPY Gemfile* .
COPY Gemfile* ./
RUN bundle install

COPY . .
RUN \
SECRET_KEY_BASE="placeholder" \
bundle exec rake assets:precompile

RUN rm -rf ./node_modules

FROM ruby:3.0-alpine

WORKDIR /usr/src/app
COPY --from=0 . .

EXPOSE 3214
ENTRYPOINT ["bin/docker-entrypoint.sh"]
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
2 changes: 1 addition & 1 deletion bin/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e

echo "Preparing database..."
Expand Down

0 comments on commit 4611142

Please sign in to comment.