Skip to content

Commit

Permalink
Don't require database in GHA docker workflow check
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwi committed Sep 30, 2023
1 parent b6dae06 commit 16cec22
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Start
run: |
docker run --rm --name=rails-on-docker --env SECRET_KEY_BASE=dummy ${{ env.TEST_TAG }}
docker run -d --rm --name=rails-on-docker --env SECRET_KEY_BASE=dummy ${{ env.TEST_TAG }}
- name: Logs
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN gem update --system && gem install bundler

WORKDIR /usr/src/app

ENTRYPOINT ["./bin/dev-docker-entrypoint"]
ENTRYPOINT ["./bin/docker-entrypoint"]

EXPOSE 3000

Expand Down
11 changes: 0 additions & 11 deletions bin/dev-docker-entrypoint

This file was deleted.

15 changes: 9 additions & 6 deletions bin/docker-entrypoint
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash -e
#!/bin/bash
set -e

# If running the rails server then create or migrate existing database
# if [ "${*}" == "./bin/rails server" ]; then
# ./bin/rails db:prepare
# fi
# Remove a potentially pre-existing server.pid for Rails.
rm -f /usr/src/app/tmp/pids/server.pid

exec "${@}"
echo "bundle install..."
bundle check || bundle install --jobs 4

# Then exec the container's main process (what's set as CMD in the Dockerfile).
exec "$@"
8 changes: 8 additions & 0 deletions bin/docker-entrypoint-production
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash -e

# If running the rails server then create or migrate existing database
# if [ "${*}" == "./bin/rails server" ]; then
# ./bin/rails db:prepare
# fi

exec "${@}"
2 changes: 1 addition & 1 deletion production.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ RUN useradd rails --create-home --shell /bin/bash && \
USER rails:rails

# Entrypoint prepares the database.
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
ENTRYPOINT ["/rails/bin/docker-entrypoint-production"]

# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
Expand Down

0 comments on commit 16cec22

Please sign in to comment.