Skip to content

Commit

Permalink
release tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
rphillips committed Aug 25, 2019
1 parent 6496826 commit c2aab0a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 27 deletions.
1 change: 0 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ env:
before:
hooks:
- make build-frontend
- make deps

builds:
- binary: escapepod
Expand Down
28 changes: 2 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
ARG NODE_VERSION=12.8.0
ARG GOLANG_VERSION=1.12.9

# Frontend Dependencies (cache)
FROM node:${NODE_VERSION} as frontend-deps
WORKDIR /escapepod
ADD frontend-vue/yarn.lock frontend-vue/package.json frontend-vue/
RUN cd frontend-vue && yarn install

# Frontend build
FROM node:${NODE_VERSION} as frontend
WORKDIR /escapepod
COPY . .
COPY --from=frontend-deps /escapepod/frontend-vue/node_modules frontend-vue/node_modules
RUN make build-frontend

# Backend build
FROM golang:${GOLANG_VERSION} as build
RUN go get github.com/knadh/stuffbin/stuffbin
WORKDIR /escapepod
COPY . .
COPY --from=frontend /escapepod/frontend-vue/dist frontend-vue/dist
RUN make dist

# Production image
FROM alpine:latest AS deploy
RUN apk --no-cache add ca-certificates
WORKDIR /escapepod
COPY --from=build /escapepod/escapepod .
WORKDIR /app
COPY escapepod .
COPY escapepod.toml.sample escapepod.toml
CMD ["./escapepod", "serve"]
31 changes: 31 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ARG NODE_VERSION=12.8.0
ARG GOLANG_VERSION=1.12.9

# Frontend Dependencies (cache)
FROM node:${NODE_VERSION} as frontend-deps
WORKDIR /escapepod
ADD frontend-vue/yarn.lock frontend-vue/package.json frontend-vue/
RUN cd frontend-vue && yarn install

# Frontend build
FROM node:${NODE_VERSION} as frontend
WORKDIR /escapepod
COPY . .
COPY --from=frontend-deps /escapepod/frontend-vue/node_modules frontend-vue/node_modules
RUN make build-frontend

# Backend build
FROM golang:${GOLANG_VERSION} as build
RUN go get github.com/knadh/stuffbin/stuffbin
WORKDIR /escapepod
COPY . .
COPY --from=frontend /escapepod/frontend-vue/dist frontend-vue/dist
RUN make dist

# Production image
FROM alpine:latest AS deploy
RUN apk --no-cache add ca-certificates
WORKDIR /escapepod
COPY --from=build /escapepod/escapepod .
COPY escapepod.toml.sample escapepod.toml
CMD ["./escapepod", "serve"]

0 comments on commit c2aab0a

Please sign in to comment.