-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
72 lines (45 loc) · 2.02 KB
/
Dockerfile
File metadata and controls
72 lines (45 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM node:24-bookworm-slim AS web-builder
ENV PNPM_HOME=/pnpm
ENV PATH=$PNPM_HOME:$PATH
RUN corepack enable
WORKDIR /app
COPY . .
RUN pnpm install --frozen-lockfile
RUN pnpm --filter @icoretech/wootty-web build
FROM golang:1.26-bookworm AS server-builder
WORKDIR /src
COPY apps/server/go.mod apps/server/go.sum ./apps/server/
RUN cd apps/server && go mod download
COPY apps/server ./apps/server
COPY --from=web-builder /app/apps/web/dist ./apps/server/internal/webassets/dist
RUN cd apps/server && CGO_ENABLED=0 go build -o /out/woottyd ./cmd/woottyd
FROM debian:bookworm-slim AS runtime-base
RUN apt-get update \
&& apt-get install -y --no-install-recommends bash ca-certificates \
&& rm -rf /var/lib/apt/lists/*
FROM runtime-base AS runtime-openssh
RUN apt-get update \
&& apt-get install -y --no-install-recommends openssh-client \
&& rm -rf /var/lib/apt/lists/*
FROM runtime-openssh AS final-openssh
WORKDIR /app/apps/server
COPY --from=server-builder /out/woottyd /usr/local/bin/wootty
RUN ln -s /usr/local/bin/wootty /usr/local/bin/woottyd \
&& ln -s /usr/local/bin/wootty /app/apps/server/woottyd
LABEL org.opencontainers.image.source="https://github.com/icoretech/wootty" \
org.opencontainers.image.url="https://github.com/icoretech/wootty" \
org.opencontainers.image.description="WooTTY browser terminal image with OpenSSH client runtime." \
org.opencontainers.image.licenses="MIT"
EXPOSE 8080
CMD ["wootty", "run", "--host", "0.0.0.0"]
FROM runtime-base AS final
WORKDIR /app/apps/server
COPY --from=server-builder /out/woottyd /usr/local/bin/wootty
RUN ln -s /usr/local/bin/wootty /usr/local/bin/woottyd \
&& ln -s /usr/local/bin/wootty /app/apps/server/woottyd
LABEL org.opencontainers.image.source="https://github.com/icoretech/wootty" \
org.opencontainers.image.url="https://github.com/icoretech/wootty" \
org.opencontainers.image.description="WooTTY browser terminal image with minimal bash runtime." \
org.opencontainers.image.licenses="MIT"
EXPOSE 8080
CMD ["wootty", "run", "--host", "0.0.0.0"]