I'm trying to develop the rails application using docker.
docker-compose run web rails db:migrate
I was able to verify that the database was created by running , but when I accessed localhost:3000, I saw the following:
This page is not working No data was sent from localhost.
ERR_EMPTY_RESPONSE
As an assumption, we expect the rails application default page to appear.
I'd like someone to give me some advice.
docker-compose.yml
version: '3'
services:
db:
image —postgres
environment:
POSTGRES_USER: 'postgresql'
POSTGRES_PASSWORD: 'postgresql-pass'
restart —always
web:
build:.
command: bundle exec rails -p 3000-b '0.0.0.0'
volumes:
- .:/myapp
ports:
- "3000:3000"
depend_on:
- db
Dockerfile
FROM ruby: 2.3.3
RUN apt-get update-qq & apt-get install-y build-essential libpq-dev nodejs
RUN mkdir /myapp
WORKDIR/myapp
COPY Gemfile/myapp/Gemfile
COPY Gemfile.lock/myapp/Gemfile.lock
RUN bundle install
COPY.
Tried
Accessed at http://0.0.0:3000
→ No change
Accessed at http://127.0.0.1:3000
→ No change
docker-composer run webrails
already existed
docker-compose exec webbash
entered the virtual environment and typed the following command:
The standard HTML file was retrieved, so it seems to be working properly in a virtual environment.
curl localhost:3000
〜〜〜
<h1>Yay! You’reon Rails!</h1>
〜〜〜
I was building a separate swarm cluster and it was disturbing.
The docker warm leave -- force command pulled out of the swarm cluster and ran docker up-d again, and it worked.
569 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
570 Who developed the "avformat-59.dll" that comes with FFmpeg?
614 Uncaught (inpromise) Error on Electron: An object could not be cloned
903 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.