-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
33 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ env: | |
before: | ||
hooks: | ||
- make build-frontend | ||
- make deps | ||
|
||
builds: | ||
- binary: escapepod | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |