AnthoLume/Dockerfile

21 lines
548 B
Docker
Raw Normal View History

2023-09-18 23:57:18 +00:00
FROM alpine:edge AS build
RUN apk add --no-cache --update go gcc g++
WORKDIR /app
COPY . /app
# Copy Resources
RUN mkdir -p /opt/bookmanager
RUN cp -a ./templates /opt/bookmanager/templates
RUN cp -a ./assets /opt/bookmanager/assets
# Download Dependencies & Compile
2023-09-18 23:57:18 +00:00
RUN go mod download
RUN CGO_ENABLED=1 CGO_CFLAGS="-D_LARGEFILE64_SOURCE" go build -o /opt/bookmanager/server
2023-09-18 23:57:18 +00:00
# Create Image
2023-09-18 23:57:18 +00:00
FROM alpine:3.18
COPY --from=build /opt/bookmanager /opt/bookmanager
WORKDIR /opt/bookmanager
2023-09-18 23:57:18 +00:00
EXPOSE 8585
ENTRYPOINT ["/opt/bookmanager/server", "serve"]