Improve build system and Docker configuration

- Switch Dockerfile base image from golang:1.23-bookworm to debian:12-slim
- Update Dockerfile to use pre-built binary instead of building in container
- Fix Docker CMD to use new CLI flag format with --listen and --root-path
- Update Makefile to build binary to ./dist/ directory with CGO_ENABLED=0
- Make build-docker target depend on build target for efficiency
- Change clean target to remove ./dist directory instead of single binary
This commit is contained in:
2025-05-26 13:29:33 +03:00
parent 28008a320d
commit 7ea36d23dd
2 changed files with 8 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
FROM golang:1.23-bookworm
FROM debian:12-slim
RUN apt-get update && apt-get upgrade -y
@@ -9,7 +9,8 @@ COPY ./gemserve /app/gemserve
WORKDIR /app
RUN chmod +x /app/gemserve && \
chown -R user:user /app
chown -R root:root /app && \
chmod -R 755 /app
USER user
CMD ["/app/gemserve","0.0.0.0:1965"]
CMD ["/app/gemserve","--listen","0.0.0.0:1965","--root-path","/srv"]