Your music, beautifully tracked. All yours. (coming soon)
teal.fm
teal-fm
atproto
1FROM node:22-slim AS builder
2ARG CLIENT_ADDRESS
3
4ENV PNPM_HOME="/pnpm"
5ENV PATH="$PNPM_HOME:$PATH"
6RUN corepack enable
7# Set working directory
8WORKDIR /app
9
10# Copy root workspace files
11COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
12
13# Copy turbo.json
14COPY turbo.json ./
15
16# Copy workspace packages
17COPY packages/db/ ./packages/db/
18COPY packages/lexicons/ ./packages/lexicons/
19COPY packages/tsconfig/ ./packages/tsconfig/
20
21# Copy lexicons source data
22COPY lexicons/ ./lexicons/
23
24# Copy the aqua app
25COPY apps/amethyst/ ./apps/amethyst/
26
27# Copy .env
28COPY ../../.env ./apps/amethyst/.env
29
30# Install dependencies and generate lexicons
31RUN cd tools/lexicon-cli && pnpm build
32
33# Generate lexicons before building amethyst
34RUN pnpm lex:gen-server
35
36RUN pnpm install
37
38# Build the amethyst app
39WORKDIR /app/apps/amethyst
40RUN pnpm run build:web
41
42#create the client-json
43RUN echo '{ \
44 "redirect_uris": ["https://'"${CLIENT_ADDRESS}"'/auth/callback"], \
45 "response_types": ["code"], \
46 "grant_types": ["authorization_code", "refresh_token"], \
47 "scope": "atproto transition:generic", \
48 "token_endpoint_auth_method": "none", \
49 "application_type": "web", \
50 "client_id": "https://'"${CLIENT_ADDRESS}"'/client-metadata.json", \
51 "client_name": "teal", \
52 "client_uri": "https://'"${CLIENT_ADDRESS}"'", \
53 "dpop_bound_access_tokens": true \
54 }' > /app/client-metadata.json
55
56
57FROM caddy:2.1.0-alpine AS caddy
58EXPOSE 80
59EXPOSE 443
60EXPOSE 443/udp
61COPY /apps/amethyst/Caddyfile /etc/caddy/Caddyfile
62COPY --from=builder /app/apps/amethyst/build /srv
63COPY --from=builder /app/client-metadata.json /srv/client-metadata.json