ci: fix few Docker issues and use multi stage builds for a lighter image

This commit is contained in:
rramiachraf 2024-03-13 14:13:12 +00:00
parent cdc6dc418f
commit 36a7a7ca72
2 changed files with 24 additions and 2 deletions

View File

@ -1,4 +1,6 @@
FROM golang:1.19.4-alpine3.17 FROM golang:1.22.1-alpine3.19 as build
RUN apk add make git
WORKDIR /code WORKDIR /code
@ -8,6 +10,17 @@ RUN go mod download
COPY . . COPY . .
RUN make build RUN make build
FROM alpine:3.19
RUN adduser user -D
USER user
WORKDIR /home/user/dumb
COPY --from=build /code/dumb .
COPY --from=build /code/static static
EXPOSE 5555/tcp EXPOSE 5555/tcp
CMD ["/code/dumb"] CMD ["./dumb"]

View File

@ -6,6 +6,15 @@ With the massive daily increase of useless scripts on Genius's web frontend, and
![Screenshot](https://raw.githubusercontent.com/rramiachraf/dumb/main/screenshot.png) ![Screenshot](https://raw.githubusercontent.com/rramiachraf/dumb/main/screenshot.png)
## Installation & Usage ## Installation & Usage
### Docker
```bash
git clone https://github.com/rramiachraf/dumb
cd dumb
docker buildx build -t dumb .
docker run -p 8080:5555 --name dumb dumb
```
### Your own machine
[Go 1.20+](https://go.dev/dl) is required. [Go 1.20+](https://go.dev/dl) is required.
```bash ```bash
git clone https://github.com/rramiachraf/dumb git clone https://github.com/rramiachraf/dumb