Skip to content

Commit

Permalink
🔧 chore: Update Dockerfile for release mode setup
Browse files Browse the repository at this point in the history
- Removed build-args for environment variables
- Set default CMD to execute the compiled binary
- Ensured multi-stage build for efficient image size

Related issue: #18
  • Loading branch information
yuminn-k committed Mar 5, 2024
1 parent cd10006 commit e08db29
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
# Description: Dockerfile for building the go application
FROM golang:1.19-alpine3.16 AS builder

# Set the current working directory inside the container
ARG MYSQL_DATABASE
ARG MYSQL_USER
ARG MYSQL_PASSWORD
ARG MYSQL_HOST
ARG MYSQL_PORT
ARG RUN_MIGRATIONS

WORKDIR /app

# Copy go mod and sum files and download dependencies
Expand All @@ -17,8 +9,8 @@ RUN go mod download

COPY . .

# Build the application
RUN go build -o main .
# Set the current working directory inside the container
RUN CGO_ENABLED=0 GOOS=linux go build -o main .

# Run the application
FROM alpine:3.16
Expand Down

0 comments on commit e08db29

Please sign in to comment.