feat: Update Docker deployment scripts and configurations for default admin account creation

This commit is contained in:
2025-07-28 21:55:11 +02:00
parent aada481c0a
commit 225d16c1c9
5 changed files with 20 additions and 14 deletions

View File

@@ -22,14 +22,16 @@ docker-compose up
docker-compose -f docker-compose.prod.yml up --build
```
**Note**: Both development and production Docker builds automatically create the default admin account.
### 2. Deploy from Git Repository
#### Using Environment Variables
Create a `.env` file with:
```env
GIT_REPO_URL=https://github.com/yourusername/your-repo.git
GIT_BRANCH=main
GIT_REPO_URL=https://git.wastpol.pl/Admin/panel.git
GIT_BRANCH=ui-fix
GIT_COMMIT=abc123 # Optional: specific commit hash
```
@@ -42,8 +44,8 @@ docker-compose -f docker-compose.prod.yml up --build
```bash
docker build \
--build-arg GIT_REPO_URL=https://github.com/yourusername/your-repo.git \
--build-arg GIT_BRANCH=main \
--build-arg GIT_REPO_URL=https://git.wastpol.pl/Admin/panel.git \
--build-arg GIT_BRANCH=ui-fix \
--build-arg GIT_COMMIT=abc123 \
-t your-app .
```
@@ -52,10 +54,10 @@ docker build \
```bash
# Linux/Mac
./deploy.sh https://github.com/yourusername/your-repo.git main abc123
./deploy.sh https://git.wastpol.pl/Admin/panel.git ui-fix abc123
# Windows
deploy.bat https://github.com/yourusername/your-repo.git main abc123
deploy.bat https://git.wastpol.pl/Admin/panel.git ui-fix abc123
```
## Private Repositories
@@ -65,13 +67,13 @@ For private repositories, you have several options:
### 1. SSH Keys (Recommended for development)
```bash
# Build with SSH URL
docker build --build-arg GIT_REPO_URL=git@github.com:yourusername/your-repo.git .
docker build --build-arg GIT_REPO_URL=git@git.wastpol.pl:Admin/panel.git .
```
### 2. Personal Access Token
```bash
# Build with token in URL
docker build --build-arg GIT_REPO_URL=https://token@github.com/yourusername/your-repo.git .
docker build --build-arg GIT_REPO_URL=https://username:token@git.wastpol.pl/Admin/panel.git .
```
### 3. Docker Secrets (Recommended for production)
@@ -82,7 +84,7 @@ services:
build:
context: .
args:
- GIT_REPO_URL=https://github.com/yourusername/your-repo.git
- GIT_REPO_URL=https://git.wastpol.pl/Admin/panel.git
secrets:
- git_token
secrets:
@@ -117,8 +119,8 @@ jobs:
```bash
# Set environment variables in your CI/CD system
export GIT_REPO_URL="https://github.com/yourusername/your-repo.git"
export GIT_BRANCH="main"
export GIT_REPO_URL="https://git.wastpol.pl/Admin/panel.git"
export GIT_BRANCH="ui-fix"
export GIT_COMMIT="$CI_COMMIT_SHA"
# Deploy
@@ -144,7 +146,7 @@ When `GIT_REPO_URL` is not provided:
## Default Admin Account
The Docker build process automatically creates a default admin account with these credentials:
Both development and production Docker builds automatically create a default admin account with these credentials:
- **Email**: `admin@localhost.com`
- **Password**: `admin123456`