Initial commit: Complete NodeJS-native setup
- Migrated from Python pre-commit to NodeJS-native solution - Reorganized documentation structure - Set up Husky + lint-staged for efficient pre-commit hooks - Fixed Dockerfile healthcheck issue - Added comprehensive documentation index
This commit is contained in:
76
docker/README.md
Normal file
76
docker/README.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# 🐳 Docker Configuration
|
||||
|
||||
This directory contains all Docker and containerization-related files for RxMinder.
|
||||
|
||||
## Files
|
||||
|
||||
- **`Dockerfile`** - Multi-stage Docker build configuration with buildx support
|
||||
- **`docker-compose.yaml`** - Service orchestration with multi-platform support
|
||||
- **`docker-bake.hcl`** - Advanced buildx configuration for multi-platform builds
|
||||
- **`nginx.conf`** - Production web server configuration
|
||||
- **`.dockerignore`** - Files and directories to exclude from Docker build context
|
||||
|
||||
## Docker Buildx Support
|
||||
|
||||
This project now supports Docker Buildx for multi-platform builds (AMD64 and ARM64).
|
||||
|
||||
### Quick Start with Buildx
|
||||
|
||||
```bash
|
||||
# Setup buildx builder (run once)
|
||||
../scripts/buildx-helper.sh setup
|
||||
|
||||
# Build for local platform only (faster for development)
|
||||
../scripts/buildx-helper.sh build-local
|
||||
|
||||
# Build for multiple platforms
|
||||
../scripts/buildx-helper.sh build-multi
|
||||
|
||||
# Build and push to registry
|
||||
../scripts/buildx-helper.sh push docker.io/username latest
|
||||
|
||||
# Build using Docker Bake (advanced)
|
||||
../scripts/buildx-helper.sh bake
|
||||
```
|
||||
|
||||
### Manual Buildx Commands
|
||||
|
||||
```bash
|
||||
# Create and use buildx builder
|
||||
docker buildx create --name rxminder-builder --driver docker-container --bootstrap --use
|
||||
|
||||
# Build for multiple platforms
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t rxminder:latest --load .
|
||||
|
||||
# Build with bake file
|
||||
docker buildx bake -f docker-bake.hcl
|
||||
```
|
||||
|
||||
## Traditional Usage
|
||||
|
||||
From the project root directory:
|
||||
|
||||
```bash
|
||||
# Build and start services
|
||||
docker compose -f docker/docker-compose.yaml up -d
|
||||
|
||||
# View logs
|
||||
docker compose -f docker/docker-compose.yaml logs
|
||||
|
||||
# Stop services
|
||||
docker compose -f docker/docker-compose.yaml down
|
||||
```
|
||||
|
||||
## Build Process
|
||||
|
||||
The Dockerfile uses a multi-stage build:
|
||||
|
||||
1. **Builder stage**: Installs dependencies and builds the React app
|
||||
2. **Production stage**: Serves the built app with nginx
|
||||
|
||||
## Services
|
||||
|
||||
- **frontend**: React application served by nginx
|
||||
- **couchdb**: Database for medication and user data
|
||||
|
||||
Both services include health checks and proper security configurations.
|
||||
Reference in New Issue
Block a user