mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-10 20:04:36 +00:00
Fix and improve
This commit is contained in:
@@ -6,8 +6,6 @@
|
||||
|
||||
### 架构概览
|
||||
|
||||
具体内容如下:
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ Docker Compose 网络 │
|
||||
@@ -35,12 +33,10 @@
|
||||
$ mkdir rails-docker && cd rails-docker
|
||||
```
|
||||
|
||||
需要创建三个文件:`Dockerfile`、`Gemfile` 和 `docker-compose.yml`。
|
||||
需要创建三个文件:`Dockerfile`、`Gemfile` 和 `compose.yaml`。
|
||||
|
||||
### Step 1: 创建 Dockerfile
|
||||
|
||||
具体内容如下:
|
||||
|
||||
```docker
|
||||
FROM ruby:3.2
|
||||
|
||||
@@ -89,9 +85,9 @@ gem 'rails', '~> 7.1'
|
||||
$ touch Gemfile.lock
|
||||
```
|
||||
|
||||
### Step 3: 创建 docker-compose.yml
|
||||
### Step 3: 创建 compose.yaml
|
||||
|
||||
Step 3: 创建 docker-compose.yml 配置如下:
|
||||
Step 3: 创建 `compose.yaml` 配置如下:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
@@ -147,7 +143,8 @@ $ docker compose run --rm web rails new . --force --database=postgresql --skip-b
|
||||
$ ls
|
||||
Dockerfile Gemfile Rakefile config lib tmp
|
||||
Gemfile.lock README.md app config.ru log vendor
|
||||
docker-compose.yml bin db public
|
||||
compose.yaml bin db public
|
||||
|
||||
```
|
||||
|
||||
> ⚠️ **Linux 用户**:如遇权限问题,执行 `sudo chown -R $USER:$USER .`
|
||||
|
||||
Reference in New Issue
Block a user