gitpod/components/proxy/Dockerfile
2025-04-25 03:00:35 -04:00

56 lines
2.1 KiB
Docker

# Copyright (c) 2021 Gitpod GmbH. All rights reserved.
# Licensed under the GNU Affero General Public License (AGPL).
# See License.AGPL.txt in the project root for license information.
FROM caddy:2.7.6-builder AS withgo
RUN go install golang.org/dl/go1.23.1@latest && \
go1.23.1 download && \
rm -rf /usr/local/go && \
mv /go /usr/local/go && \
mv /usr/local/go/bin/go1.23.1 /usr/local/go/bin/go
FROM withgo AS builder
WORKDIR /plugins
COPY plugins /plugins
# build caddy
RUN xcaddy build v2.7.6 \
--output /caddy \
--with github.com/gitpod-io/gitpod/proxy/plugins/corsorigin=/plugins/corsorigin \
--with github.com/gitpod-io/gitpod/proxy/plugins/secwebsocketkey=/plugins/secwebsocketkey \
--with github.com/gitpod-io/gitpod/proxy/plugins/workspacedownload=/plugins/workspacedownload \
--with github.com/gitpod-io/gitpod/proxy/plugins/headlesslogdownload=/plugins/headlesslogdownload \
--with github.com/gitpod-io/gitpod/proxy/plugins/configcat=/plugins/configcat \
--with github.com/gitpod-io/gitpod/proxy/plugins/analytics=/plugins/analytics \
--with github.com/gitpod-io/gitpod/proxy/plugins/logif=/plugins/logif \
--with github.com/gitpod-io/gitpod/proxy/plugins/jsonselect=/plugins/jsonselect \
--with github.com/gitpod-io/gitpod/proxy/plugins/sshtunnel=/plugins/sshtunnel \
--with github.com/gitpod-io/gitpod/proxy/plugins/frontend_dev=/plugins/frontend_dev
FROM cgr.dev/chainguard/wolfi-base:latest@sha256:e1d402d624011d0f4439bfb0d46a3ddc692465103c7234a326e0194953c3cfe0
# Ensure latest packages are present, like security updates.
RUN apk upgrade --no-cache \
&& apk add --no-cache ca-certificates bash
# Debug convenience
ENV TERM=xterm
ENV SHELL=/bin/bash
COPY --from=builder /caddy /usr/bin/caddy
COPY conf/Caddyfile /etc/caddy/Caddyfile
COPY conf/vhost.empty /etc/caddy/vhosts/vhost.empty
COPY conf/workspace-handler.* /etc/caddy/workspace-handler/
ARG __GIT_COMMIT
ARG VERSION
ENV GITPOD_BUILD_GIT_COMMIT=${__GIT_COMMIT}
ENV GITPOD_BUILD_VERSION=${VERSION}
CMD [ "caddy", "run", "--adapter", "inject-ssh-tunnel" , "--watch", "--config", "/etc/caddy/Caddyfile" ]