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

Add Dockerfile into Vatz #590

Merged
merged 3 commits into from
Aug 27, 2024
Merged
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
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Start from the official Golang image based on Debian
FROM golang:1.20-buster as builder

# Set the Current Working Directory inside the container
WORKDIR /app/vatz

# Copy the entire project into the container
COPY . .

# Run the Makefile to build the application
RUN make build

# Run vatz init to initialize the application (this should generate the binary)
RUN ./vatz init

# Start a new stage from scratch
FROM alpine:latest

WORKDIR /root/

# Copy the Pre-built binary file from the previous stage
COPY --from=builder /app/vatz/vatz ./vatz

# Expose port 8080 (or whatever port your application uses)
EXPOSE 8080

# Command to start the application, expecting a config.yaml file to be provided at runtime
CMD ["./vatz", "start", "--config", "/config/config.yaml"]
Loading