-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (19 loc) · 859 Bytes
/
Dockerfile
File metadata and controls
27 lines (19 loc) · 859 Bytes
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
FROM golang:1.26-alpine AS build
WORKDIR /src
ARG TINYCLOUD_CONTEXT_ROOT=.
# Allow the same Dockerfile to build from either the Azure tree or the repo root.
COPY ${TINYCLOUD_CONTEXT_ROOT}/go.mod ./go.mod
COPY ${TINYCLOUD_CONTEXT_ROOT}/go.sum ./go.sum
COPY ${TINYCLOUD_CONTEXT_ROOT}/cmd ./cmd
COPY ${TINYCLOUD_CONTEXT_ROOT}/internal ./internal
RUN go build -o /out/tinycloud ./cmd/tinycloud && \
go build -o /out/tinycloudd ./cmd/tinycloudd
FROM alpine:3.21
RUN adduser -D -u 10001 tinycloud && mkdir -p /var/lib/tinycloud && chown -R tinycloud:tinycloud /var/lib/tinycloud
USER tinycloud
WORKDIR /app
COPY --from=build /out/tinycloud /usr/local/bin/tinycloud
COPY --from=build /out/tinycloudd /usr/local/bin/tinycloudd
ENV TINYCLOUD_DATA_ROOT=/var/lib/tinycloud
EXPOSE 4566 4567 4577 4578 4579 4580 4581 4582 4583 4584/udp 4585
CMD ["tinycloudd"]