Skip to content

Commit

Permalink
fixed dockerfile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
chefgs committed May 23, 2024
1 parent 1d6ea17 commit 8f3181e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
# Start from the latest golang base image
FROM golang:alpine

# Add Maintainer Info
LABEL org.opencontainers.image.source=https://github.com/chefgs/linktoqr
LABEL description="This container image can be used to generate QR from the given URL or Text."
LABEL org.opencontainers.image.licenses=MIT

# Set necessary environmet variables needed for our image
# Set necessary environment variables needed for our image
ENV CGO_ENABLED=0 \
GOOS=linux
GOOS=linux \
GO111MODULE=on

WORKDIR $GOPATH/src/linktoqr
# Move to working directory /linktoqr
WORKDIR /linktoqr

COPY ./*go* .
# Copy and download dependency using go mod
COPY go.mod .
RUN go mod tidy

RUN go build -o /linktoqr
# Copy the code into the container
COPY . .

# Export necessary port
EXPOSE 1718

CMD ["/linktoqr"]
# Command to run the executable
CMD ["go", "run", "./..."]

0 comments on commit 8f3181e

Please sign in to comment.