···1-FROM ghcr.io/bigmoves/quickslice:latest
2-3-# Copy custom lexicons into the image
4-COPY ./lexicons /app/server/priv/lexicons
···0000
-135
example/README.md
···1-# quickslice Docker Example
2-3-This example demonstrates how to run quickslice using the published Docker image with custom lexicons.
4-5-## Directory Structure
6-7-```
8-example/
9-├── Dockerfile # Custom Dockerfile (optional)
10-├── docker-compose.yml # Docker Compose configuration
11-├── lexicons/ # Custom lexicons directory
12-│ └── xyz/
13-│ └── statusphere/
14-│ └── status.json
15-└── README.md # This file
16-```
17-18-## Quick Start
19-20-### Using Docker Compose (Recommended)
21-22-```bash
23-cd example
24-docker-compose up
25-```
26-27-The server will be available at `http://localhost:8000`
28-29-### Using Docker Directly
30-31-```bash
32-cd example
33-docker run -p 8000:8000 \
34- -v $(pwd)/lexicons:/app/server/priv/lexicons:ro \
35- ghcr.io/bigmoves/quickslice:latest
36-```
37-38-## Custom Lexicons
39-40-The `lexicons/` directory is mounted to `/app/server/priv/lexicons` in the container. This allows you to provide custom AT Protocol lexicons without rebuilding the image.
41-42-### Adding Your Own Lexicon
43-44-1. Create a directory structure following the NSID format:
45- ```
46- lexicons/
47- └── com/
48- └── example/
49- └── myrecord.json
50- ```
51-52-2. Create your lexicon JSON file:
53- ```json
54- {
55- "lexicon": 1,
56- "id": "com.example.myrecord",
57- "defs": {
58- "main": {
59- "type": "record",
60- "key": "tid",
61- "record": {
62- "type": "object",
63- "required": ["text"],
64- "properties": {
65- "text": {
66- "type": "string",
67- "maxLength": 300
68- },
69- "createdAt": {
70- "type": "string",
71- "format": "datetime"
72- }
73- }
74- }
75- }
76- }
77- }
78- ```
79-80-3. Restart the container to load the new lexicon
81-82-## Environment Variables
83-84-You can customize the server configuration using environment variables in `docker-compose.yml`:
85-86-- `HOST` - Server host (default: `0.0.0.0`)
87-- `PORT` - Server port (default: `8000`)
88-89-## GraphQL Endpoint
90-91-Once running, access the GraphQL endpoint at:
92-- `http://localhost:8000/graphql`
93-94-## Volume Mounts
95-96-- `./lexicons:/app/server/priv/lexicons:ro` - Mounts local lexicons directory as read-only
97-98-The `:ro` flag makes the mount read-only for security.
99-100-## Stopping the Server
101-102-```bash
103-docker compose down
104-```
105-106-## Pulling Latest Image
107-108-```bash
109-docker compose pull
110-docker compose up -d
111-```
112-113-## Troubleshooting
114-115-### Port Already in Use
116-117-If port 8000 is already in use, change it in `docker-compose.yml`:
118-119-```yaml
120-ports:
121- - "3000:8000" # Maps local port 3000 to container port 8000
122-```
123-124-### Lexicons Not Loading
125-126-Ensure your lexicon files:
127-1. Follow the correct directory structure (namespace/path/file.json)
128-2. Have valid JSON syntax
129-3. Match the NSID in the filename path
130-131-### Viewing Logs
132-133-```bash
134-docker-compose logs -f quickslice
135-```