feat: Added multistage build, removed unnecessary stuff from final image by only leaving the built binary. Added env variables reading instructions in Makefile

This commit is contained in:
jonaustin09
2023-11-27 14:23:52 -05:00
parent 3feddbd698
commit 452152ad11
2 changed files with 7 additions and 3 deletions
+5 -1
View File
@@ -10,6 +10,10 @@ COPY ./ ./
WORKDIR /app/cmd/versitygw
RUN go build -o versitygw
FROM alpine:latest
RUN mkdir /tmp/vgw
ENTRYPOINT [ "./versitygw" ]
COPY --from=0 /app/cmd/versitygw/versitygw /app/versitygw
ENTRYPOINT [ "/app/versitygw" ]
+2 -2
View File
@@ -78,12 +78,12 @@ dist: $(BIN).spec
# Creates and runs S3 gateway instance in a docker container
.PHONY: up-posix
up-posix:
docker compose up posix
docker compose --env-file .env.dev up posix
# Creates and runs S3 gateway proxy instance in a docker container
.PHONY: up-proxy
up-proxy:
docker compose up proxy
docker compose --env-file .env.dev up proxy
# Creates and runs both S3 gateway and proxy server instances in docker containers
.PHONY: up-app