Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker support (Dockerfile) #9

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Use an official Golang runtime as the base image
FROM golang:1.16 as builder

# Set the working directory in the container
WORKDIR /app

# Copy the source code to the container
COPY . .

# Build the application
RUN make build

# Use a lightweight Alpine image as the base image for the final container
FROM alpine:latest

# Set the working directory in the container
WORKDIR /app

# Copy the binary from the builder stage to the final container
COPY --from=builder /app/listmonk-messenger.bin .

# Copy the config.toml file (adjust the path if necessary)
COPY config.toml .

# Expose the port that the application listens on (adjust if necessary)
EXPOSE 8082

# Run the application
CMD ["./listmonk-messenger.bin", "--config", "config.toml", "--msgr", "pinpoint", "--msgr", "ses"]