Skip to content

Commit

Permalink
Add Dockerfile into Vatz (#590)
Browse files Browse the repository at this point in the history
* Add Dockerfile into Vatz

* Update Dockerfile
- from Debian to Alpine

* Update Dockerfile
- from Debian to Alpine
  • Loading branch information
xellos00 committed Aug 27, 2024
1 parent aefd02f commit b86370c
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 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"]

0 comments on commit b86370c

Please sign in to comment.