Update Dockerfile
This commit is contained in:
parent
d86bc2be07
commit
73dce3d1f3
33
Dockerfile
33
Dockerfile
@ -1,12 +1,16 @@
|
|||||||
FROM node:latest as frontend-builder
|
FROM node:alpine as frontend-builder
|
||||||
RUN mkdir -p /app/frontend
|
WORKDIR /app
|
||||||
COPY web/frontend/yarn.lock /app/frontend/yarn.lock
|
COPY frontend/package.json /app
|
||||||
COPY web/frontend/package.json /app/frontend/package.json
|
COPY frontend/package-lock.json /app
|
||||||
WORKDIR /app/frontend
|
RUN npm install
|
||||||
RUN yarn install
|
COPY frontend .
|
||||||
COPY web/frontend /app/frontend
|
RUN npm run build
|
||||||
WORKDIR /app/frontend
|
|
||||||
RUN GENERATE_SOURCEMAP=false yarn build
|
FROM alpine:latest as geoip-fetcher
|
||||||
|
RUN apk add --no-cache git
|
||||||
|
WORKDIR /app
|
||||||
|
RUN git clone https://github.com/geoacumen/geoacumen-country.git
|
||||||
|
RUN find .
|
||||||
|
|
||||||
FROM golang:latest as builder
|
FROM golang:latest as builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@ -14,16 +18,15 @@ COPY go.mod /app/go.mod
|
|||||||
COPY go.sum /app/go.sum
|
COPY go.sum /app/go.sum
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
COPY . /app
|
COPY . /app
|
||||||
RUN rm -rf /app/server/frontend
|
COPY --from=geoip-fetcher /app/geoacumen-country/Geoacumen-Country.mmdb honeypot/ssh
|
||||||
COPY --from=frontend-builder /app/frontend/dist /app/web/frontend/dist
|
COPY --from=frontend-builder /app/dist /app/web/frontend/dist
|
||||||
RUN CGO_ENABLED=0 INSTALL_PREFIX=/app make install
|
RUN CGO_ENABLED=0 go build -tags embed cmd/apiary/apiary.go
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
RUN apk add --no-cache curl
|
RUN apk add --no-cache curl
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=builder /app/etc/apiary/apiary.toml /app/apiary.toml
|
COPY --from=builder /app/apiary.toml /app/apiary.toml
|
||||||
COPY --from=builder /app/bin/apiary /app/apiary
|
COPY --from=builder /app/apiary /app/apiary
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
EXPOSE 2222
|
EXPOSE 2222
|
||||||
HEALTHCHECK --interval=1m --timeout=10s --start-period=5s --retries=3 CMD curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8080/api/health || exit 1
|
|
||||||
CMD ["/app/apiary", "serve"]
|
CMD ["/app/apiary", "serve"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user