質問編集履歴
1
Dockerfile等のファイルを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -41,3 +41,85 @@
|
|
41
41
|
- [How can I resolve “Your bundle only supports platforms [”x86-mingw32“] but your local platforms are [”ruby“, ”x86_64-linux“]”](https://stackoverflow.com/questions/43429685/how-can-i-resolve-your-bundle-only-supports-platforms-x86-mingw32-but-your/44350326)
|
42
42
|
|
43
43
|
- [Bad error when installing with --deployment without a lockfile](https://github.com/bundler/bundler/issues/5532)
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
### 追記
|
48
|
+
|
49
|
+
Dockerfile等のファイルの載せるの忘れてました????
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
```Dockerfile
|
54
|
+
|
55
|
+
FROM ruby:2.5-slim
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
LABEL Name=docker_rails Version=0.0.1
|
60
|
+
|
61
|
+
EXPOSE 5000
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
# throw errors if Gemfile has been modified since Gemfile.lock
|
66
|
+
|
67
|
+
RUN bundle config --global frozen 1
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
WORKDIR /app
|
72
|
+
|
73
|
+
COPY . /app
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
COPY Gemfile Gemfile.lock ./
|
78
|
+
|
79
|
+
RUN bundle install
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
CMD ["ruby", "docker_rails.rb"]
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
```
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
docker-compose.yml
|
92
|
+
|
93
|
+
```docker-compose.yml
|
94
|
+
|
95
|
+
version: '2.1'
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
services:
|
100
|
+
|
101
|
+
docker_rails:
|
102
|
+
|
103
|
+
image: docker_rails
|
104
|
+
|
105
|
+
build: .
|
106
|
+
|
107
|
+
ports:
|
108
|
+
|
109
|
+
- 5000:5000
|
110
|
+
|
111
|
+
```
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
```Gemfile
|
116
|
+
|
117
|
+
source 'https://rubygems.org'
|
118
|
+
|
119
|
+
gem 'rails', '5.2.1'
|
120
|
+
|
121
|
+
```
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
Gemfile.lockは空のままです。
|