apiary/Dockerfile

28 lines
811 B
Docker
Raw Normal View History

2021-04-10 05:58:01 +00:00
FROM node:latest as frontend-builder
RUN mkdir -p /app/frontend
COPY web/frontend/yarn.lock /app/frontend/yarn.lock
COPY web/frontend/package.json /app/frontend/package.json
WORKDIR /app/frontend
RUN yarn install
COPY web/frontend /app/frontend
WORKDIR /app/frontend
RUN GENERATE_SOURCEMAP=false yarn build
FROM golang:latest as builder
WORKDIR /app
COPY go.mod /app/go.mod
COPY go.sum /app/go.sum
RUN go mod download
COPY . /app
RUN rm -rf /app/server/frontend
COPY --from=frontend-builder /app/frontend/dist /app/web/frontend/dist
2021-04-10 06:12:06 +00:00
RUN CGO_ENABLED=0 INSTALL_PREFIX=/app make install
2021-04-10 05:58:01 +00:00
FROM alpine:latest
RUN apk add --no-cache curl
WORKDIR /app
2021-04-10 06:12:06 +00:00
COPY --from=builder /app/etc/apiary/apiary.toml /app/apiary.toml
COPY --from=builder /app/bin/apiary /app/apiary
2021-04-10 05:58:01 +00:00
EXPOSE 8080
EXPOSE 2222
CMD ["/app/apiary", "serve"]