Skip to content

Commit 2e62220

Browse files
authored
Merge pull request #351 from Trim/docker-img-go
Use minimal deploy Bullseye Docker image for linuxfr-img
2 parents 18ac2c1 + 31ae3e8 commit 2e62220

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

deployment/linuxfr-img/Dockerfile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
FROM debian:stretch-slim
1+
FROM debian:bullseye-slim as build
22

33
LABEL maintainer="[email protected]"
4-
LABEL version="1.0"
5-
LABEL description="Run LinuxFr image caching service for LinuxFr.org Ruby on Rails website"
4+
LABEL version="2.0"
5+
LABEL description="Run LinuxFr image caching service for LinuxFr.org"
66

7+
ENV GOPATH=/linuxfr-img
78
WORKDIR /linuxfr-img
89

9-
# Install dependencies
10+
# Build linuxfr-img
1011
RUN apt-get update \
1112
&& apt-get install -y --no-install-recommends \
1213
golang git ca-certificates \
13-
&& apt-get clean
14+
&& apt-get clean \
15+
&& go get -u github.com/linuxfrorg/img-LinuxFr.org
1416

15-
# Install linuxfr-img
16-
ENV GOPATH=/linuxfr-img/go
17-
ENV PATH=${PATH}:/linuxfr-img/go/bin
18-
RUN go get -u github.com/linuxfrorg/img-LinuxFr.org
17+
FROM debian:bullseye-slim as deploy
18+
19+
WORKDIR /linuxfr-img
20+
21+
COPY --from=build /linuxfr-img/bin/img-LinuxFr.org .
1922

2023
EXPOSE 8000
2124

22-
CMD ["sh", "-c", "exec img-LinuxFr.org -a 0.0.0.0:8000 -r \"${REDIS_URL##redis://}\""]
25+
CMD ["sh", "-c", "exec ./img-LinuxFr.org -a 0.0.0.0:8000 -r \"${REDIS_URL##redis://}\""]

0 commit comments

Comments
 (0)