Files

122 lines
2.4 KiB
Markdown

# Docker Setup for Who Did It?
This document describes how to build and deploy the Who Did It? app using Docker.
## Prerequisites
- Docker installed and running
- Access to `docker-registry.kolpacksoftware.com`
- Docker login credentials for the registry
## Quick Start
### Build the Image
**Windows (PowerShell):**
```powershell
.\docker-build.ps1
```
**Linux/Mac:**
```bash
chmod +x docker-build.sh
./docker-build.sh
```
**Manual:**
```bash
docker build -t docker-registry.kolpacksoftware.com/clue-picker:latest .
```
### Push to Registry
**Windows (PowerShell):**
```powershell
.\docker-push.ps1
```
**Linux/Mac:**
```bash
chmod +x docker-push.sh
./docker-push.sh
```
**Manual:**
```bash
docker login docker-registry.kolpacksoftware.com
docker push docker-registry.kolpacksoftware.com/clue-picker:latest
```
### Run the Container
```bash
docker run -d \
-p 3001:3001 \
-e ADMIN_PASSWORD=clue2024 \
-e ALLOWED_NAMES="Jim,Colleen,Rory,Gigi,Meghan,Christine,Bob,Rachel,Chuck" \
-v ./server-data:/app/server/data \
--name clue-picker \
docker-registry.kolpacksoftware.com/clue-picker:latest
```
## Environment Variables
- `PORT` - Server port (default: 3001)
- `ADMIN_PASSWORD` - Password required to clear submissions (default: clue2024)
- `ALLOWED_NAMES` - Comma-separated list of allowed player names
Example:
```bash
docker run -d \
-p 3001:3001 \
-e ADMIN_PASSWORD=your-secret \
-e ALLOWED_NAMES="Alice,Bob,Carol" \
-v ./server-data:/app/server/data \
docker-registry.kolpacksoftware.com/clue-picker:latest
```
## Volume Mount for Persistence
To persist submissions across container restarts, mount the data directory:
```bash
-v ./server-data:/app/server/data
```
## Custom Image Name/Tag
**Windows:**
```powershell
.\docker-build.ps1 -ImageName "who-did-it" -Tag "v1.0.0"
.\docker-push.ps1 -ImageName "who-did-it" -Tag "v1.0.0"
```
**Linux/Mac:**
```bash
IMAGE_NAME="who-did-it" TAG="v1.0.0" ./docker-build.sh
IMAGE_NAME="who-did-it" TAG="v1.0.0" ./docker-push.sh
```
## Docker Compose (Optional)
```yaml
version: '3.8'
services:
web:
image: docker-registry.kolpacksoftware.com/clue-picker:latest
ports:
- "3001:3001"
environment:
- PORT=3001
- ADMIN_PASSWORD=clue2024
- ALLOWED_NAMES=Jim,Colleen,Rory,Gigi,Meghan,Christine,Bob,Rachel,Chuck
volumes:
- ./server-data:/app/server/data
```
Then run:
```bash
docker-compose up
```