Skip to content

Commit

Permalink
Try to push new back-end config.
Browse files Browse the repository at this point in the history
  • Loading branch information
elarsaks committed Jul 31, 2023
1 parent 9c3d270 commit edcf3d3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
10 changes: 4 additions & 6 deletions cmd/blockchain_server/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Builder Stage
FROM golang:1.18.0-alpine AS builder

# Install git.
# GCC is also necessary for cgo.
RUN apk update && apk add --no-cache git gcc musl-dev

# Set the working directory inside the container
WORKDIR /app

Expand All @@ -10,9 +14,6 @@ COPY go.mod go.sum ./
# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
RUN go mod download

# Install the "air" tool for live-reloading (if needed)
RUN go install github.com/cosmtrek/air@latest

# Copy the entire parent_folder into the container
COPY . .

Expand All @@ -31,9 +32,6 @@ WORKDIR /app
# Copy the binary from builder stage
COPY --from=builder /app/main .

# Install ca-certificates
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*

# Expose the port
EXPOSE ${BLOCKCHAIN_SERVER_PORT}

Expand Down
22 changes: 9 additions & 13 deletions cmd/wallet_server/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Start from the base Golang image as builder stage
# Start from the base Golang image
FROM golang:1.18.0-alpine AS builder

# Install git.
# GCC is also necessary for cgo.
RUN apk update && apk add --no-cache git gcc musl-dev

# Set the working directory inside the container
WORKDIR /app

Expand All @@ -21,18 +25,10 @@ RUN go build -o main .

# Start a new stage from scratch
FROM alpine:latest AS runner

# Add ca-certificates in case you need them
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*

# Set the working directory
WORKDIR /app

# Copy the binary file from the builder stage
COPY --from=builder /app/cmd/wallet_server/main ./main

# Set the port number to expose
EXPOSE 8080
# Copy the binary from builder
COPY --from=builder /app/cmd/wallet_server/main .

# Set the default command to run the application
CMD ["./main"]
# Set the command to run when starting the container
CMD ["/app/main"]

0 comments on commit edcf3d3

Please sign in to comment.