Skip to content

Instantly share code, notes, and snippets.

@yutakahashi114
Last active September 30, 2019 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yutakahashi114/e55976d40aa096b10cef97e3fe391363 to your computer and use it in GitHub Desktop.
Save yutakahashi114/e55976d40aa096b10cef97e3fe391363 to your computer and use it in GitHub Desktop.
# 開発
FROM golang:latest as dev
RUN apt-get update \
&& apt-get install -y vim \
&& curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
# 本番ビルド用
FROM golang:latest as builder
WORKDIR /go/src/app/
COPY ./src/app .
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build server.go
# 本番
FROM alpine:latest as prod
EXPOSE 8080
WORKDIR /api
COPY --from=builder /go/src/app/server .
CMD ["./server"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment