Add Dockerfile and make directives #18

Merged
davidlick merged 1 commits from containerize into main 2021-06-21 16:55:56 +00:00
2 changed files with 25 additions and 0 deletions
Showing only changes of commit cfdfbe1cca - Show all commits
+11
View File
@@ -0,0 +1,11 @@
FROM golang:1.16-alpine
WORKDIR /go/src/github.com/davidlick/supermarket-api/
COPY . .
WORKDIR ./cmd/api/
RUN go build -o supermarket-api -v ./...
EXPOSE 3000
CMD ["./supermarket-api"]
+14
View File
@@ -22,5 +22,19 @@ build:
run:
go run cmd/api/*.go
docker-build:
docker build -t supermarket-api-image .
docker-run:
docker run \
--rm \
--name supermarket-api \
-p "3000:3000" \
-e "ENV=dev" \
-e "APIPORT=3000" \
-e "LOGLEVEL=debug" \
-e "DMLINITFILE=../../defaultproduce.json" \
supermarket-api-image
clean:
rm ./supermarket-api ./coverage.out