Skip to content

Commit

Permalink
Dockerfile: new all-in-one Dockerfile including all build process
Browse files Browse the repository at this point in the history
  • Loading branch information
nemunaire committed Oct 28, 2021
1 parent 9dd8592 commit a8c7c2a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dockers:
image_templates:
- "listmonk/listmonk:latest"
- "listmonk/listmonk:{{ .Tag }}"
dockerfile: Dockerfile
dockerfile: Dockerfile-builded
extra_files:
- config.toml.sample
- config-demo.toml
16 changes: 15 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
FROM node:lts-alpine AS frontend-builder
RUN apk --no-cache add make grep
COPY frontend frontend/
COPY Makefile VERSION ./
RUN make build-frontend

FROM golang:alpine AS backend-builder
RUN apk --no-cache add make grep
WORKDIR /go/listmonk
COPY . .
COPY --from=frontend-builder frontend/dist frontend/dist/
RUN sed -i 's/pack-bin: build-frontend/pack-bin:/' Makefile && \
make pack-bin

FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /listmonk
COPY listmonk .
COPY --from=backend-builder /go/listmonk/listmonk .
COPY config.toml.sample config.toml
COPY config-demo.toml .
CMD ["./listmonk"]
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile-builded
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /listmonk
COPY listmonk .
COPY config.toml.sample config.toml
COPY config-demo.toml .
CMD ["./listmonk"]
EXPOSE 9000

0 comments on commit a8c7c2a

Please sign in to comment.