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.
356 Unity Virtual Stick Does Not Return to Center When You Release Your Finger
340 Memory layouts learned in theory don't work out as expected when actually printed as addresses.
353 I have saved several codes written in python to a visual studio file.
367 To Limit Column Values to Strings in a String List Using sqlalchemy
© 2023 OneMinuteCode. All rights reserved.