Skip to content

Commit 610687f

Browse files
author
Parinda Darden
committed
Removes server.pid file before starting rails server. Adds .dockerignore file to instructions.
1 parent 78c6dda commit 610687f

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

sites/en/installfest/create_a_rails_app_with_docker.step

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ step "Create a new Rails app" do
5656
stdin_open: true
5757
volumes:
5858
- .:/test_app
59-
command: bin/rails s -p 3000 -b '0.0.0.0'
59+
command: bash -c 'rm -rf /test_app/tmp/pids/server.pid && bin/rails s -p 3000 -b 0.0.0.0'
6060
ports:
6161
- "3000:3000"
6262
depends_on:
@@ -66,6 +66,18 @@ step "Create a new Rails app" do
6666
driver: local
6767
CONTENTS
6868

69+
message "In your editor, create a new file called `.dockerignore`:"
70+
message "Copy the following into `.dockerignore`:"
71+
source_code :text, <<-CONTENTS
72+
.git
73+
.dockerignore
74+
.byebug_history
75+
log/*
76+
tmp/*
77+
Dockerfile
78+
README.md
79+
CONTENTS
80+
6981
message "Build your rails app:"
7082
console "docker-compose run web rails new . --force --database=postgresql"
7183
console "docker-compose build"

sites/en/intro-to-rails/getting_started.step

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ steps do
7373
RUN bundle install
7474
COPY . $APP_HOME
7575
CONTENTS
76+
7677
message "In your editor, create a new file called `docker-compose.yml`:"
7778
message "Copy the following into `docker-compose.yml`:"
7879
source_code :text, <<-CONTENTS
@@ -90,7 +91,7 @@ steps do
9091
stdin_open: true
9192
volumes:
9293
- .:/suggestotron
93-
command: bin/rails s -p 3000 -b '0.0.0.0'
94+
command: bash -c 'rm -rf /suggestotron/tmp/pids/server.pid && bin/rails s -p 3000 -b 0.0.0.0'
9495
ports:
9596
- "3000:3000"
9697
depends_on:
@@ -99,10 +100,24 @@ steps do
99100
db_data:
100101
driver: local
101102
CONTENTS
103+
104+
message "In your editor, create a new file called `.dockerignore`:"
105+
message "Copy the following into `.dockerignore`:"
106+
source_code :text, <<-CONTENTS
107+
.git
108+
.dockerignore
109+
.byebug_history
110+
log/*
111+
tmp/*
112+
Dockerfile
113+
README.md
114+
CONTENTS
115+
102116
message "Build your rails app:"
103117
console "docker-compose run web rails new . --force --database=postgresql"
104118
message "The `rails new` command creates a Rails project with the name you give. In this case we used `.` which is a shorthand for the current directory which happens to be `suggestotron`. We'll go into detail on what it created shortly. This and the following steps will all print a lot of stuff to the screen and might take a while to finish."
105119
console "docker-compose build"
120+
106121
message "Setup the database:"
107122
message "In your editor, open up `config/database.yml` and change it to the following:"
108123
source_code :ruby, <<-CONTENTS

sites/en/job-board/create_a_rails_app.step

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ option "With Docker" do
7676
stdin_open: true
7777
volumes:
7878
- .:/job_board
79-
command: bin/rails s -p 3000 -b '0.0.0.0'
79+
command: bash -c 'rm -rf /job_board/tmp/pids/server.pid && bin/rails s -p 3000 -b 0.0.0.0'
8080
ports:
8181
- "3000:3000"
8282
depends_on:
@@ -86,6 +86,18 @@ option "With Docker" do
8686
driver: local
8787
CONTENTS
8888

89+
message "In your editor, create a new file called `.dockerignore`:"
90+
message "Copy the following into `.dockerignore`:"
91+
source_code :text, <<-CONTENTS
92+
.git
93+
.dockerignore
94+
.byebug_history
95+
log/*
96+
tmp/*
97+
Dockerfile
98+
README.md
99+
CONTENTS
100+
89101
message "Build your rails app:"
90102
console "docker-compose run web rails new . --force --database=postgresql -T --skip-turbolinks"
91103
console "docker-compose build"

0 commit comments

Comments
 (0)