Skip to content

Commit

Permalink
feat: optimize docker build (#827)
Browse files Browse the repository at this point in the history
  • Loading branch information
1lkei authored Nov 27, 2024
1 parent 85fe92a commit dc9b501
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ RUN CGO_ENABLED=0 go build -tags nosqlite,web \
-ldflags="-s -w -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION -X github.com/GopeedLab/gopeed/pkg/base.InDocker=true" \
-o dist/gopeed github.com/GopeedLab/gopeed/cmd/web

FROM alpine:3.14.2
FROM alpine:3.18
LABEL maintainer="monkeyWie"
WORKDIR /app
COPY --from=go /app/dist/gopeed ./
COPY entrypoint.sh ./entrypoint.sh
RUN apk update && \
apk upgrade --no-cache && \
apk add --no-cache bash su-exec; \
apk add --no-cache su-exec ; \
chmod +x ./entrypoint.sh && \
rm -rf /var/cache/apk/*
VOLUME ["/app/storage"]
Expand Down
25 changes: 14 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
version: '3'

services:
gopeed:
container_name: gopeed
ports:
- "9999:9999" # HTTP port (host:container)
image: liwei2633/gopeed
volumes:
- ~/gopeed/Downloads:/app/Downloads # mount download path
#- ~/gopeed/storage:/app/storage # if you need to mount storage path, uncomment this line
restart: unless-stopped
gopeed:
container_name: gopeed
ports:
- 9999:9999 # HTTP port (host:container)
environment:
- PUID=0
- PGID=0
- UMASK=022
volumes:
- ~/gopeed/Downloads:/app/Downloads # mount download path
#- ~/gopeed/storage:/app/storage # if you need to mount storage path, uncomment this line
restart: unless-stopped
image: liwei2633/gopeed
# command: -u Username -p Password # optional authentication

0 comments on commit dc9b501

Please sign in to comment.