質問編集履歴

1

docker-compose.yml Dockerfile 情報の追加

2021/09/16 04:30

投稿

yk12000
yk12000

スコア9

test CHANGED
File without changes
test CHANGED
@@ -39,3 +39,139 @@
39
39
 
40
40
 
41
41
  ご教示のほどよろしくお願いいたします。
42
+
43
+
44
+
45
+ **<<追記>>**
46
+
47
+ ・docker-comppose.yml
48
+
49
+ ```ここに言語を入力
50
+
51
+ version: '3'
52
+
53
+ services:
54
+
55
+ app:
56
+
57
+ ports:
58
+
59
+ - "8000:80"
60
+
61
+ build: ./docker/app
62
+
63
+ container_name: laravel_app
64
+
65
+ volumes:
66
+
67
+ - ./src:/var/www/html
68
+
69
+
70
+
71
+ db:
72
+
73
+ image: mysql:5.7
74
+
75
+ container_name: laravel_db
76
+
77
+ environment:
78
+
79
+ MYSQL_ROOT_PASSWORD: root
80
+
81
+ MYSQL_DATABASE: laravel_db
82
+
83
+ MYSQL_USER: laravel_user
84
+
85
+ MYSQL_PASSWORD: laravel_pass
86
+
87
+ TZ: Asia/Tokyo
88
+
89
+ command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
90
+
91
+ volumes:
92
+
93
+ - ./docker/db/data:/var/lib/mysql
94
+
95
+ - ./docker/db/my.cnf:/etc/mysql/conf.d/my.cnf
96
+
97
+ ports:
98
+
99
+ - 3306:3306
100
+
101
+
102
+
103
+ phpmyadmin:
104
+
105
+ image: phpmyadmin/phpmyadmin
106
+
107
+ environment:
108
+
109
+ - PMA_ARBITRARY=1
110
+
111
+ - PMA_HOST=db #mysqlサービス名を指定
112
+
113
+ - PMA_USER=root
114
+
115
+ - PMA_PASSWORD=root
116
+
117
+ links:
118
+
119
+ - db
120
+
121
+ ports:
122
+
123
+ - 4040:80
124
+
125
+ volumes:
126
+
127
+ - ./phpmyadmin/sessions:/sessions
128
+
129
+
130
+
131
+ ```
132
+
133
+
134
+
135
+ ・Dockerfile
136
+
137
+ ```ここに言語を入力
138
+
139
+ FROM php:7.4-apache
140
+
141
+
142
+
143
+ ADD php.ini /usr/local/etc/php/
144
+
145
+ ADD 000-default.conf /etc/apache2/sites-enabled/
146
+
147
+
148
+
149
+ RUN cd /usr/bin && curl -s http://getcomposer.org/installer | php && ln -s /usr/bin/composer.phar /usr/bin/composer
150
+
151
+
152
+
153
+ RUN apt-get update \
154
+
155
+ && apt-get install -y \
156
+
157
+ git \
158
+
159
+ zip \
160
+
161
+ unzip \
162
+
163
+ vim \
164
+
165
+ libpng-dev \
166
+
167
+ libpq-dev \
168
+
169
+ && docker-php-ext-install pdo_mysql
170
+
171
+
172
+
173
+ RUN mv /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled
174
+
175
+ RUN /bin/sh -c a2enmod rewrite
176
+
177
+ ```