mirror of
https://github.com/umputun/reproxy.git
synced 2025-07-06 22:15:41 +02:00
switch final image to scratch base
This commit is contained in:
25
Dockerfile
25
Dockerfile
@ -10,7 +10,8 @@ ENV CGO_ENABLED=0
|
||||
ADD . /build
|
||||
WORKDIR /build
|
||||
|
||||
RUN apk add -u git
|
||||
RUN apk add --no-cache --update git tzdata ca-certificates
|
||||
|
||||
RUN \
|
||||
if [ -z "$CI" ] ; then \
|
||||
echo "runs outside of CI" && version=$(git rev-parse --abbrev-ref HEAD)-$(git log -1 --format=%h)-$(date +%Y%m%dT%H:%M:%S); \
|
||||
@ -19,23 +20,11 @@ RUN \
|
||||
cd app && go build -o /build/reproxy -ldflags "-X main.revision=${version} -s -w"
|
||||
|
||||
|
||||
FROM alpine:3.13
|
||||
FROM scratch
|
||||
|
||||
ENV \
|
||||
TERM=xterm-color \
|
||||
TIME_ZONE=UTC
|
||||
|
||||
RUN \
|
||||
apk add --no-cache --update tzdata curl ca-certificates dumb-init && \
|
||||
cp /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime && \
|
||||
echo "${TIME_ZONE}" > /etc/timezone && date && \
|
||||
ln -s /usr/bin/dumb-init /sbin/dinit && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
COPY init.sh /init.sh
|
||||
COPY --from=backend /usr/share/zoneinfo /usr/share/zoneinfo
|
||||
COPY --from=backend /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
COPY --from=backend /build/reproxy /srv/reproxy
|
||||
RUN chmod +x /srv/reproxy
|
||||
WORKDIR /srv
|
||||
|
||||
ENTRYPOINT ["/init.sh"]
|
||||
CMD ["/srv/reproxy"]
|
||||
WORKDIR /srv
|
||||
ENTRYPOINT ["/srv/reproxy"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
FROM umputun/reproxy:master
|
||||
ENV TIME_ZONE=America/Chicago
|
||||
ENV TZ=America/Chicago
|
||||
COPY assets /web
|
||||
EXPOSE 80
|
||||
CMD ["/srv/reproxy", "--assets.location=/web", "--listen=0.0.0.0:80"]
|
||||
CMD ["--assets.location=/web", "--listen=0.0.0.0:80"]
|
@ -5,6 +5,3 @@ services:
|
||||
hostname: reproxy-embed
|
||||
ports:
|
||||
- "80:80"
|
||||
environment:
|
||||
- LISTEN=0.0.0.0:8080
|
||||
- ASSETS_LOCATION=/web
|
||||
|
2
examples/assets/external/Dockerfile
vendored
2
examples/assets/external/Dockerfile
vendored
@ -1,4 +1,4 @@
|
||||
FROM umputun/reproxy:master
|
||||
ENV TIME_ZONE=America/Chicago
|
||||
EXPOSE 80
|
||||
CMD ["/srv/reproxy", "--assets.location=/web", "--listen=0.0.0.0:80"]
|
||||
CMD ["--assets.location=/web", "--listen=0.0.0.0:80"]
|
3
examples/assets/external/docker-compose.yml
vendored
3
examples/assets/external/docker-compose.yml
vendored
@ -7,6 +7,3 @@ services:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- ./assets:/web
|
||||
environment:
|
||||
- LISTEN=0.0.0.0:8080
|
||||
- ASSETS_LOCATION=/web
|
||||
|
@ -3,20 +3,18 @@ services:
|
||||
image: umputun/reproxy:master
|
||||
container_name: reproxy
|
||||
hostname: reproxy
|
||||
labels:
|
||||
reproxy.enabled: "false" # don't include reproxy to automatic destinations
|
||||
ports:
|
||||
- "80:8080"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- ./web:/web
|
||||
environment:
|
||||
- TZ=America/Chicago
|
||||
- LISTEN=0.0.0.0:8080
|
||||
- DOCKER_ENABLED=true
|
||||
- DOCKER_AUTO=true
|
||||
- ASSETS_LOCATION=/web
|
||||
- DEBUG=true
|
||||
- TIME_ZONE=America/Chicago
|
||||
|
||||
# automatic destination, will be mapped for ^/api/svc1/(.*)
|
||||
svc1:
|
||||
|
Reference in New Issue
Block a user