Skip to content

Commit

Permalink
Add Dockerfile into Vatz
Browse files Browse the repository at this point in the history
  • Loading branch information
xellos00 committed Aug 21, 2024
1 parent aefd02f commit 59c1729
Showing 1 changed file with 28 additions and 0 deletions.
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 debian:buster-slim

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"]

0 comments on commit 59c1729

Please sign in to comment.