Skip to content

Instantly share code, notes, and snippets.

@mkamakura
Last active March 2, 2018 12:15
Show Gist options
  • Save mkamakura/d6c238d00d9526917d1491149fc59d94 to your computer and use it in GitHub Desktop.
Save mkamakura/d6c238d00d9526917d1491149fc59d94 to your computer and use it in GitHub Desktop.
Golang(API Server) Local Environment
FROM golang:1.9.4-alpine
RUN apk update \
&& apk upgrade \
&& apk add --no-cache bash git openssh curl coreutils
RUN go get github.com/golang/dep/cmd/dep
RUN go get github.com/codegangsta/gin
RUN mkdir -p /go/src/github.com/mkamakura/myProject/backend
EXPOSE 4000
EXPOSE 4001
WORKDIR /go/src/github.com/mkamakura/myProject/backend
CMD bash -c "dep ensure && gin -a 4001 -p 4000"
@mkamakura
Copy link
Author

docker-compose.yml

  api:
    build: ./backend
    ports:
      - 4000:4000
      - 4001:4001
    volumes:
      - ./backend:/go/src/github.com/mkamakura/myProject/backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment