株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

基礎となるdocker-compose.ymlを作って、差分用のファイルを環境ごとに用意するイメージ。

up:
	docker-compose -f docker-compose.yml -f docker-compose-prd.yml up -d

local-up:
	docker-compose -f docker-compose.yml -f docker-compose-dev.yml up -d

基礎となるdocker-compose.yml

version: "3.7"
services:
  nginx:
    build:
      context: ./nginx/
      dockerfile: ./Dockerfile
    ports:
      - "80:80"
    networks:
      - deployment-network
    links:
      - web
      - server

差分用のdocker-compose-dev.yaml

services:
  nginx:
    logging:
      driver: "awslogs"
      options:
        awslogs-region: "ap-northeast-1"
        awslogs-group: "server"
        tag: '{{ with split .ImageName ":" }}{{join . "_"}}{{end}}-{{.ID}}' # stream nameの名前 "image名_tag-ID"
        awslogs-create-group: "true" # groupがなければ作成される

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)