Skip to content

Instantly share code, notes, and snippets.

@Daniel1984
Created April 22, 2020 16:55
Show Gist options
  • Save Daniel1984/43b90bb48f9aa5ad06845f903ef761b9 to your computer and use it in GitHub Desktop.
Save Daniel1984/43b90bb48f9aa5ad06845f903ef761b9 to your computer and use it in GitHub Desktop.
# Start from golang v1.13.4 base image to have access to go modules
FROM golang:1.13.4
# create a working directory
WORKDIR /app
# Fetch dependencies on separate layer as they are less likely to
# change on every build and will therefore be cached for speeding
# up the next build
COPY ./go.mod ./go.sum ./
RUN go mod download
# copy source from the host to the working directory inside
# the container
COPY . .
# This container exposes port 7777 to the outside world
EXPOSE 7777
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment