Skip to content

Commit

Permalink
ci(dockerfile): expose necessary ports for the application (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigBalthazar authored Oct 8, 2024
1 parent c15b810 commit 702dfbc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,38 @@
# --------------------------
FROM golang:1.22.5-alpine AS builder

# Set the working directory inside the container
WORKDIR /app

# Install required build tools
#* Install required build tools
RUN apk --no-cache add build-base git

# Cache dependencies by copying go.mod and go.sum first
#* Cache dependencies by copying go.mod and go.sum first
COPY go.mod go.sum ./
RUN go mod download

# Copy the rest of the application source code
#* Copy the rest of the application source code
COPY . .

# Build the Go binary using the provided Makefile
#* Build the Go binary using the provided Makefile
RUN make build

# --------------------------
#! Stage 2: Create the runtime image
# --------------------------
FROM alpine:latest

# Set the working directory inside the runtime container
WORKDIR /app

# Define build-time arguments and environment variables
#* Define build-time arguments and environment variables
ARG IMMO_MONGO_URI
ENV IMMO_MONGO_URI=${IMMO_MONGO_URI}

# Copy the compiled binary from the builder stage
#* Copy the compiled binary from the builder stage
COPY --from=builder /app/build/immortal .

# Copy the default configuration (can be overridden later in a wrapping image)
COPY --from=builder /app/config/config.yml ./config.yml
#* Expose necessary ports for the application
EXPOSE 7777
EXPOSE 8888

# Set the entrypoint to run the application
ENTRYPOINT ["./immortal", "run", "./config.yml"]
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var (
major = 0
minor = 0
patch = 1
meta = "beta"
meta = ""
)

func StringVersion() string {
Expand Down

0 comments on commit 702dfbc

Please sign in to comment.