4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Golangをdocker-composeで動かすdocker-compose.yml

Posted at

メモ用

go mod initでファイルつくる
go mod downloadでいろいろダウンロードする
go buildで勝手にごにょごにょしてコンパイルする

bash.sh
go mod init
go build
docker-compose.yml
version: '2'

services:
  app:
    image: 'golang:1.11'
    ports:
    - '8585:8585'
    volumes:
    - '.:/root/go/src/github.com/{YOU-USER-NAME}/{APP-NAME}/'
    working_dir: '/root/go/src/github.com/{YOU-USER-NAME}/{APP-NAME}/'
    command: bash -c 'go mod download && go run main.go'
    environment:
    - 'GO111MODULE=on'

volumes:
  data:
    driver: 'local'
4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?