Skip to content

Instantly share code, notes, and snippets.

@derianpt
Created October 10, 2018 09:09
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 derianpt/696d7a787049846dae1dae1b13a9d615 to your computer and use it in GitHub Desktop.
Save derianpt/696d7a787049846dae1dae1b13a9d615 to your computer and use it in GitHub Desktop.
FROM golang:latest
# Install tools required for project (postgres, git, gcc, curl, glide) less
# likely to change, so put it up here to take advantage of cache
RUN apk add postgresql;\
apk add git; \
apk add build-base; \
apk add curl; \
curl https://glide.sh/get | sh;
# Set working directory
WORKDIR /go/src/github.com/balibone/web-server
# Copy over glide files. Build cache will only be invalidated if glide files were changed.
COPY glide.* ./
# Copy over bash script used to install CLI tools. Build cache will only be
# invalidated if this bash script was changed.
COPY get_dependencies.sh ./
# Install CLI tools & dependecies
RUN /bin/sh ./get_dependencies.sh &&\
glide install
# Copy over source code
COPY . .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment