Fix dead link

Signed-off-by: Kang HuaiShuai <khs1994@khs1994.com>
pull/413/head
Kang HuaiShuai 2019-07-03 12:06:31 +08:00
parent b9247c16df
commit 710c1ec457
No known key found for this signature in database
GPG Key ID: 0A380828B1C243A7
2 changed files with 15 additions and 3 deletions

View File

@ -18,7 +18,7 @@ RUN pip install -r requirements.txt
COPY . /code/ COPY . /code/
``` ```
使 Python `Dockerfile` [](../image/create.md# Dockerfile ) [ Dockerfile 使](../dockerfile/README.md) 使 Python `Dockerfile` [ Dockerfile 使](../image/dockerfile/README.md)
`requirements.txt` `requirements.txt`
@ -67,7 +67,7 @@ Dockerfile docker-compose.yml django_example manage.py
Linux, Linux,
```bash ```bash
sudo chown -R $USER:$USER . $ sudo chown -R $USER:$USER .
``` ```
`django_example/settings.py` `DATABASES = ...` `django_example/settings.py` `DATABASES = ...`

View File

@ -17,13 +17,16 @@ ADD Gemfile /myapp/Gemfile
RUN bundle install RUN bundle install
ADD . /myapp ADD . /myapp
``` ```
使 RubyBundler Dockerfile [](../image/create.md# Dockerfile ) [Dockerfile 使](../dockerfile/README.md)
使 RubyBundler Dockerfile [Dockerfile 使](../image/dockerfile/README.md)
Rails `Gemfile` `rails new` Rails `Gemfile` `rails new`
```bash ```bash
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'rails', '4.0.2' gem 'rails', '4.0.2'
``` ```
`docker-compose.yml` `docker-compose.yml` 西 web 使 PostgreSQL web `docker-compose.yml` `docker-compose.yml` 西 web 使 PostgreSQL web
```yaml ```yaml
@ -45,11 +48,13 @@ services:
links: links:
- db - db
``` ```
使 `docker-compose run` 使 `docker-compose run`
```bash ```bash
$ docker-compose run web rails new . --force --database=postgresql --skip-bundle $ docker-compose run web rails new . --force --database=postgresql --skip-bundle
``` ```
`Compose` 使 `Dockerfile` web 使 `rails new ` `Compose` 使 `Dockerfile` web 使 `rails new `
```bash ```bash
@ -60,16 +65,19 @@ Gemfile.lock condocker-compose log
README.rdoc condocker-compose.ru public README.rdoc condocker-compose.ru public
Rakefile db test Rakefile db test
``` ```
`Gemfile` `therubyracer` 便使 Javascript `Gemfile` `therubyracer` 便使 Javascript
```bash ```bash
gem 'therubyracer', platforms: :ruby gem 'therubyracer', platforms: :ruby
``` ```
`Gemfile` Dockerfile `Gemfile` Dockerfile
```bash ```bash
$ docker-compose build $ docker-compose build
``` ```
Rails `localhost` `db` postgres Rails `localhost` `db` postgres
`database.yml` `database.yml`
@ -87,11 +95,13 @@ test:
<<: *default <<: *default
database: myapp_test database: myapp_test
``` ```
```bash ```bash
$ docker-compose up $ docker-compose up
``` ```
PostgreSQL PostgreSQL
```bash ```bash
@ -99,11 +109,13 @@ myapp_web_1 | [2014-01-17 17:16:29] INFO WEBrick 1.3.1
myapp_web_1 | [2014-01-17 17:16:29] INFO ruby 2.0.0 (2013-11-22) [x86_64-linux-gnu] myapp_web_1 | [2014-01-17 17:16:29] INFO ruby 2.0.0 (2013-11-22) [x86_64-linux-gnu]
myapp_web_1 | [2014-01-17 17:16:29] INFO WEBrick::HTTPServer#start: pid=1 port=3000 myapp_web_1 | [2014-01-17 17:16:29] INFO WEBrick::HTTPServer#start: pid=1 port=3000
``` ```
```bash ```bash
$ docker-compose run web rake db:create $ docker-compose run web rake db:create
``` ```
web docker 3000 web docker 3000
![](../_images/docker-compose-rails-screenshot.png) ![](../_images/docker-compose-rails-screenshot.png)