gitpod/components/proxy/Dockerfile
2022-01-17 16:22:10 +01:00

47 lines
1.6 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 golang:1.17 as builder
RUN curl -fsSL https://github.com/caddyserver/xcaddy/releases/download/v0.2.0/xcaddy_0.2.0_linux_amd64.tar.gz \
| tar -xzv -C /usr/local/bin/ xcaddy
WORKDIR /plugins
COPY plugins /plugins
# build caddy
RUN xcaddy build v2.4.5 \
--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/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
FROM alpine:3.15
# 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
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" ]