ci: fix few Docker issues and use multi stage builds for a lighter image
This commit is contained in:
parent
cdc6dc418f
commit
36a7a7ca72
17
Dockerfile
17
Dockerfile
@ -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
|
||||
|
||||
@ -8,6 +10,17 @@ RUN go mod download
|
||||
COPY . .
|
||||
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
|
||||
|
||||
CMD ["/code/dumb"]
|
||||
CMD ["./dumb"]
|
||||
|
||||
|
@ -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)
|
||||
|
||||
## 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.
|
||||
```bash
|
||||
git clone https://github.com/rramiachraf/dumb
|
||||
|
Loading…
x
Reference in New Issue
Block a user