personal-servers/reverse_proxy/Dockerfile

30 lines
941 B
Docker
Raw Normal View History

2022-05-03 16:10:33 +00:00
FROM alpine:latest as builder
WORKDIR /app
COPY . ./
# This is where one could build the application code as well.
FROM alpine:latest as tailscale
WORKDIR /app
COPY . ./
2024-07-21 00:09:25 +00:00
ENV TSFILE=tailscale_1.68.2_amd64.tgz
2022-05-03 16:10:33 +00:00
RUN wget https://pkgs.tailscale.com/stable/${TSFILE} && tar xzf ${TSFILE} --strip-components=1
COPY . ./
# https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds
FROM alpine:latest
RUN apk update && apk add --no-cache ca-certificates iptables ip6tables nginx
# Copy binary to production image
COPY --from=builder /app/start.sh /app/start.sh
COPY --from=tailscale /app/tailscaled /app/tailscaled
COPY --from=tailscale /app/tailscale /app/tailscale
2022-06-27 20:18:19 +00:00
RUN mkdir -p /var/run/tailscale /var/cache/tailscale /var/lib/tailscale /usr/share/nginx/html
2022-05-03 16:10:33 +00:00
COPY nginx.conf /etc/nginx/http.d/nginx.conf
2022-06-27 20:18:19 +00:00
COPY custom_50x.html /usr/share/nginx/html/
2022-05-03 16:10:33 +00:00
# Run on container startup.
EXPOSE 8080
CMD ["/app/start.sh"]