-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs/test: Add dev setup and update docs (#23)
* feat: Add development environment configuration - Create dev/dev.sh script for simplified development workflow - Add docker-compose.dev.yml for local development setup - Update .gitignore to exclude dev directory except specific files - Add development section to README.md with guide reference * docs: Update README and docker-compose with comprehensive setup instructions and configuration options
- Loading branch information
Showing
6 changed files
with
234 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# DumbDrop Development | ||
|
||
Because we're too dumb for complexity, development is super simple! | ||
|
||
## Quick Start | ||
|
||
1. Clone this repo | ||
2. Navigate to the `dev` directory | ||
3. Use our dumb-simple development script: | ||
|
||
```bash | ||
# Start development environment | ||
./dev.sh up | ||
|
||
# Stop development environment | ||
./dev.sh down | ||
|
||
# View logs | ||
./dev.sh logs | ||
|
||
# Rebuild without cache | ||
./dev.sh rebuild | ||
|
||
# Clean everything up | ||
./dev.sh clean | ||
``` | ||
|
||
## Development Environment Features | ||
|
||
Our development setup is sophisticatedly simple: | ||
|
||
- Builds from local Dockerfile instead of pulling image | ||
- Mounts local directory for live code changes | ||
- Uses development-specific settings | ||
- Adds helpful labels for container identification | ||
- Hot-reloading for faster development | ||
|
||
## Development-specific Settings | ||
|
||
The `docker-compose.dev.yml` includes: | ||
- Local volume mounts for live code updates | ||
- Development-specific environment variables | ||
- Container labels for easy identification | ||
- Automatic container restart for development | ||
|
||
### Node Modules Handling | ||
|
||
Our volume setup uses a technique called "volume masking" for handling node_modules: | ||
```yaml | ||
volumes: | ||
- ../:/app # Mount local code | ||
- /app/node_modules # Mask node_modules directory | ||
``` | ||
This setup: | ||
- Prevents local node_modules from interfering with container modules | ||
- Preserves container's node_modules installed during build | ||
- Avoids platform-specific module issues | ||
- Keeps development simple and consistent across environments | ||
## Directory Structure | ||
``` | ||
dev/ | ||
├── README.md # You are here! | ||
├── docker-compose.dev.yml # Development-specific Docker setup | ||
└── dev.sh # Simple development helper script | ||
``` | ||
|
||
That's it! We told you it was dumb simple! If you need more complexity, you're probably in the wrong place! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# Simple development helper script because we're too dumb for complexity | ||
|
||
case "$1" in | ||
"up") | ||
echo "🚀 Starting DumbDrop in development mode..." | ||
docker compose -f docker-compose.dev.yml up --build | ||
;; | ||
"down") | ||
echo "👋 Stopping DumbDrop development environment..." | ||
docker compose -f docker-compose.dev.yml down | ||
;; | ||
"logs") | ||
echo "📝 Showing DumbDrop logs..." | ||
docker compose -f docker-compose.dev.yml logs -f | ||
;; | ||
"rebuild") | ||
echo "🔨 Rebuilding DumbDrop..." | ||
docker compose -f docker-compose.dev.yml build --no-cache | ||
;; | ||
"clean") | ||
echo "🧹 Cleaning up development environment..." | ||
docker compose -f docker-compose.dev.yml down -v | ||
;; | ||
*) | ||
echo "DumbDrop Development Helper" | ||
echo "Usage: ./dev.sh [command]" | ||
echo "" | ||
echo "Commands:" | ||
echo " up - Start development environment" | ||
echo " down - Stop development environment" | ||
echo " logs - Show container logs" | ||
echo " rebuild - Rebuild container without cache" | ||
echo " clean - Clean up everything" | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: '3.8' | ||
|
||
services: | ||
dumbdrop: | ||
build: | ||
context: .. | ||
dockerfile: Dockerfile | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- ../:/app | ||
- /app/node_modules | ||
- ../local_uploads:/app/uploads | ||
environment: | ||
NODE_ENV: development | ||
DUMBDROP_TITLE: DumbDrop-Dev | ||
MAX_FILE_SIZE: 1024 | ||
DUMBDROP_PIN: 123456 | ||
APPRISE_MESSAGE: "[DEV] New file uploaded - {filename} ({size}), Storage used {storage}" | ||
APPRISE_SIZE_UNIT: auto | ||
# Enable container restart during development | ||
restart: unless-stopped | ||
# Add development labels | ||
labels: | ||
- "dev.dumbware.environment=development" |
Oops, something went wrong.