I've been trying to Dockerize a rails 6 app and for some reason, when I run docker-compose up I get a error about a missing port from the Thor gem which I already specified. I'm curious if anybody ran into this issue.
It runs successfully without docker.
db_1 |
db_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1 |
db_1 | LOG: database system was shut down at 2020-09-09 07:27:22 UTC
db_1 | LOG: MultiXact member wraparound protections are now enabled
db_1 | LOG: database system is ready to accept connections
db_1 | LOG: autovacuum launcher started
web_1 | /usr/local/bundle/gems/thor-1.0.1/lib/thor/parser/options.rb:228:in `parse_peek': No value provided for option '--port' (Thor::MalformattedArgumentError)
from /usr/local/bundle/gems/thor-1.0.1/lib/thor/parser/options.rb:100:in `parse'
web_1 | from /usr/local/bundle/gems/thor-1.0.1/lib/thor/base.rb:79:in `initialize'
web_1 | from /usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:26:in `initialize'
web_1 | from /usr/local/bundle/gems/thor-1.0.1/lib/thor/shell.rb:45:in `initialize'
web_1 | from /usr/local/bundle/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:127:in `initialize'
web_1 | from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:388:in `new'
web_1 | from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:388:in `dispatch'
web_1 | from /usr/local/bundle/gems/railties-6.0.3.2/lib/rails/command/base.rb:69:in `perform'
web_1 | from /usr/local/bundle/gems/railties-6.0.3.2/lib/rails/command.rb:46:in `invoke'
web_1 | from /usr/local/bundle/gems/railties-6.0.3.2/lib/rails/commands.rb:18:in `<main>'
web_1 | from /usr/local/bundle/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
web_1 | from /usr/local/bundle/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
web_1 | from /usr/local/bundle/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
web_1 | from /usr/local/bundle/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
web_1 | from /usr/local/bundle/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
web_1 | from /usr/local/bundle/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `block in require'
web_1 | from /usr/local/bundle/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:291:in `load_dependency'
web_1 | from /usr/local/bundle/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `require'
web_1 | from /market-insights/bin/rails:9:in `<top (required)>'
web_1 | from /usr/local/bundle/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load'
web_1 | from /usr/local/bundle/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call'
web_1 | from /usr/local/bundle/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
web_1 | from /usr/local/bundle/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'
web_1 | from /usr/local/bundle/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'
web_1 | from /usr/local/bundle/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'
web_1 | from /usr/local/bundle/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
web_1 | from /market-insights/bin/spring:15:in `require'
web_1 | from /market-insights/bin/spring:15:in `<top (required)>'
web_1 | from bin/rails:3:in `load'
web_1 | from bin/rails:3:in `<main>'
Dockerfile
FROM ruby:2.6.3
RUN bundle config --global frozen 1
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 -qq && apt-get install -y build-essential nodejs yarn postgresql-client
RUN mkdir /market-insights
WORKDIR /market-insights
COPY Gemfile Gemfile.lock ./
RUN bundle install
COPY . /market-insights
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"]
#!/bin/bash
set -e
# Remove a potentially pre-existing server.pid for Rails.
rm -f /market-insights/tmp/pids/server.pid
# Then exec the container's main process (what's set as CMD in the Dockerfile).
exec "$@"
Hi all,
I've been trying to Dockerize a rails 6 app and for some reason, when I run
docker-compose up
I get a error about a missing port from the Thor gem which I already specified. I'm curious if anybody ran into this issue. It runs successfully without docker.Dockerfile
docker-compose.yml
entrypoint.sh