First attempt at creating dockerfile
This commit is contained in:
20
docker/Dockerfile
Normal file
20
docker/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
FROM golang:1.23-bookworm AS base
|
||||
|
||||
# /build is the working directory
|
||||
WORKDIR /build
|
||||
|
||||
# Copy control files and pull in dependencies
|
||||
COPY go.mod .
|
||||
RUN go mod download
|
||||
|
||||
ENV port=8089
|
||||
# Copy the rest of the source code into the container
|
||||
COPY code/* .
|
||||
|
||||
# Build the app
|
||||
|
||||
RUN go build -o fibonacci
|
||||
|
||||
EXPOSE ${port}
|
||||
|
||||
CMD ["build/fibonacci"]
|
||||
Reference in New Issue
Block a user