-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |