Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
### Compile stage
FROM golang:1.26-alpine AS build-env

WORKDIR /dockerbuild
ADD . .

RUN apk add git

RUN GIT_VERSION=$(git describe --tags --long --always || echo "dev-local") && \
go mod tidy && \
go build -ldflags "-X main.Version=$GIT_VERSION" -o cocoon ./cmd/cocoon

### Run stage
FROM alpine:3 AS run

RUN apk add dumb-init curl
ENTRYPOINT ["dumb-init", "--"]

WORKDIR /
RUN mkdir -p data/cocoon
COPY --from=build-env /dockerbuild/cocoon /

COPY ./init-keys.sh /
COPY ./create-initial-invite.sh /

CMD ["/cocoon", "run"]

LABEL org.opencontainers.image.source=https://github.com/haileyok/cocoon
LABEL org.opencontainers.image.description="Cocoon ATProto PDS"
LABEL org.opencontainers.image.licenses=MIT
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Cocoon

> [!WARNING]
I migrated and have been running my main account on this PDS for months now without issue, however, I am still not responsible if things go awry, particularly during account migration. Please use caution.
> I migrated and have been running my main account on this PDS for months now without issue, however, I am still not responsible if things go awry, particularly during account migration. Please use caution.

Cocoon is a PDS implementation in Go. It is highly experimental, and is not ready for any production use.

Expand Down Expand Up @@ -170,6 +170,27 @@ COCOON_S3_CDN_URL="https://cdn.example.com"

> **Tip**: For Cloudflare R2, you can use the public bucket URL as the CDN URL. For AWS S3, you can use CloudFront or the S3 bucket URL directly if public access is enabled.

#### Alpine based image

The default image is based on Debian. You can use the Alpine-based image if you prefer.

> [!NOTE]
> Currently, we do not have pre-built Alpine-based image on the GitHub Container Registry. You have to build them locally.

In the compose file, replace every `dockerfile: Dockerfile` by `dockerfile: Dockerfile.alpine`, e.g.
```yml
services:
cocoon:
build:
context: .
dockerfile: Dockerfile.alpine
```

You can also build the image locally with
```bash
docker build -f Dockerfile.alpine -t cocoon:alpine .
```

### Management Commands

Create an invite code:
Expand Down