{"id":430,"date":"2019-04-18T11:13:45","date_gmt":"2019-04-18T02:13:45","guid":{"rendered":"http:\/\/localhost:8000\/?p=430"},"modified":"2021-01-23T11:21:30","modified_gmt":"2021-01-23T02:21:30","slug":"docker-compose-tips","status":"publish","type":"post","link":"http:\/\/localhost:8000\/2019\/04\/docker-compose-tips.html","title":{"rendered":"Docker Compose\u306eTips"},"content":{"rendered":"

Docker Compose\u306f\u8907\u6570\u306eDocker\u30b3\u30f3\u30c6\u30ca\u3092\u307e\u3068\u3081\u3066\u7acb\u3061\u4e0a\u3052\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u4fbf\u5229\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308b\u3002
\n\u3044\u304f\u3064\u304b\u306e\u30b1\u30fc\u30b9\u306b\u3064\u3044\u3066\u5b9f\u4f8b\u3092\u3042\u3052\u306a\u304c\u3089\u8a2d\u5b9a\u65b9\u6cd5\u3092\u8a18\u8f09\u3057\u3066\u3044\u3053\u3046\u3068\u601d\u3046\u3002<\/p>\n

\u5225docker-compose\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u53c2\u7167\u3059\u308b<\/h2>\n

1\u3064\u76ee\u306edocker-compose\u3067DB\u3092\u30012\u3064\u76ee\u306edocker-compose\u3067Web\u30a2\u30d7\u30ea\u3092\u7acb\u3061\u4e0a\u3052\u3066\u3001Web\u30a2\u30d7\u30ea\u304b\u3089DB\u3092\u53c2\u7167\u3059\u308b\u30b1\u30fc\u30b9\u3092\u8003\u3048\u308b\u3002
\n\u57fa\u672c\u7684\u306b\u306f\u3001network<\/code>\u3067\u540c\u4e00\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u6240\u5c5e\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3001external_links<\/code>\u3067\u5916\u90e8\u30b3\u30f3\u30c6\u30ca\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308c\u3070\u3088\u3044\u3002<\/p>\n

DB\u7528docker-compose.yml\u306e\u8a2d\u5b9a<\/h3>\n
version: '3'\nservices:\n  postgres:\n    image: postgres:latest\n    container_name: "database"<\/code><\/pre>\n