ifms_go/Dockerfile
2025-06-10 17:50:46 +08:00

31 lines
798 B
Docker

FROM golang:alpine as builder
ARG APP=ifms
ARG VERSION=v1.0.0
ARG RELEASE_TAG=$(VERSION)
# Install the required packages
# RUN apk add --no-cache musl-dev
# sqlite-dev gcc
# Set CGO_CFLAGS to enable large file support
ENV CGO_CFLAGS "-D_LARGEFILE64_SOURCE"
ENV GOPROXY="https://goproxy.cn"
WORKDIR /go/src/${APP}
COPY . .
# Build the application
#RUN go build -ldflags "-w -s -X main.VERSION=${RELEASE_TAG}" -o ./${APP} .
FROM alpine
ARG APP=ifms
WORKDIR /go/src/${APP}
COPY --from=builder /opt/${APP} /usr/bin/
COPY --from=builder /opt/configs /usr/bin/configs
# COPY --from=builder /go/src/${APP}/dist /usr/bin/dist
#ENTRYPOINT ["ifms", "start", "-d", "/usr/bin/configs", "-c", "prod", "-s", "/usr/bin/dist"]
ENTRYPOINT ["ifms", "start", "-d", "/usr/bin/configs", "-c", "dev"]
EXPOSE 8040