Skip to content

Commit dc9b501

Browse files
authored
feat: optimize docker build (#827)
1 parent 85fe92a commit dc9b501

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

Dockerfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ RUN CGO_ENABLED=0 go build -tags nosqlite,web \
88
-ldflags="-s -w -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION -X github.com/GopeedLab/gopeed/pkg/base.InDocker=true" \
99
-o dist/gopeed github.com/GopeedLab/gopeed/cmd/web
1010

11-
FROM alpine:3.14.2
11+
FROM alpine:3.18
1212
LABEL maintainer="monkeyWie"
1313
WORKDIR /app
1414
COPY --from=go /app/dist/gopeed ./
1515
COPY entrypoint.sh ./entrypoint.sh
1616
RUN apk update && \
17-
apk upgrade --no-cache && \
18-
apk add --no-cache bash su-exec; \
17+
apk add --no-cache su-exec ; \
1918
chmod +x ./entrypoint.sh && \
2019
rm -rf /var/cache/apk/*
2120
VOLUME ["/app/storage"]

docker-compose.yml

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
version: '3'
2-
31
services:
4-
gopeed:
5-
container_name: gopeed
6-
ports:
7-
- "9999:9999" # HTTP port (host:container)
8-
image: liwei2633/gopeed
9-
volumes:
10-
- ~/gopeed/Downloads:/app/Downloads # mount download path
11-
#- ~/gopeed/storage:/app/storage # if you need to mount storage path, uncomment this line
12-
restart: unless-stopped
2+
gopeed:
3+
container_name: gopeed
4+
ports:
5+
- 9999:9999 # HTTP port (host:container)
6+
environment:
7+
- PUID=0
8+
- PGID=0
9+
- UMASK=022
10+
volumes:
11+
- ~/gopeed/Downloads:/app/Downloads # mount download path
12+
#- ~/gopeed/storage:/app/storage # if you need to mount storage path, uncomment this line
13+
restart: unless-stopped
14+
image: liwei2633/gopeed
15+
# command: -u Username -p Password # optional authentication

0 commit comments

Comments
 (0)