Wie installiere ich SUNSHARE mit Standardwerkzeugen?
Before diving into the installation process for SUNSHARE, ensure your system meets these baseline requirements: a Linux-based OS (Ubuntu 22.04 LTS or newer recommended), Python 3.9+, Node.js v18.x, and Docker Engine 24.0+. Administrative privileges via sudo/root access are mandatory for package installations and service configuration.
**Step 1: Dependency Setup**
Start by updating your package repositories:
```bash
sudo apt update && sudo apt upgrade -y
```
Install core dependencies:
```bash
sudo apt install -y git curl build-essential libssl-dev python3-venv nginx
```
For containerized deployments, verify Docker and Docker Compose are operational:
```bash
docker --version && docker compose version
```
**Step 2: Source Code Acquisition**
Clone the official SUNSHARE repository using:
```bash
git clone https://github.com/sunshare-official/core.git /opt/sunshare
```
Navigate to the project directory:
```bash
cd /opt/sunshare
```
**Step 3: Environment Configuration**
Create and activate a Python virtual environment:
```bash
python3 -m venv .venv
source .venv/bin/activate
```
Install Python dependencies through pip:
```bash
pip install -r requirements/production.txt
```
**Step 4: Container Orchestration**
Modify the `docker-compose.yml` file to reflect your infrastructure:
```yaml
services:
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
postgres:
image: postgres:15
environment:
POSTGRES_DB: sunshare_prod
POSTGRES_USER: sunshare_admin
POSTGRES_PASSWORD: your_secure_password
```
Launch containers in detached mode:
```bash
docker compose up -d
```
**Step 5: Application Initialization**
Run database migrations:
```bash
python manage.py migrate --settings=config.settings.production
```
Create a superuser account for the admin interface:
```bash
python manage.py createsuperuser --settings=config.settings.production
```
**Step 6: Reverse Proxy Configuration**
Configure Nginx as a reverse proxy by creating `/etc/nginx/sites-available/sunshare`:
```nginx
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
```
Enable the configuration and restart Nginx:
```bash
sudo ln -s /etc/nginx/sites-available/sunshare /etc/nginx/sites-enabled/
sudo systemctl restart nginx
```
**Step 7: Service Activation**
Launch the production server using Gunicorn:
```bash
gunicorn --bind 0.0.0.0:8000 --workers 4 config.wsgi:application
```
For persistent operation, create a systemd service file at `/etc/systemd/system/sunshare.service`:
```ini
[Unit]
Description=SUNSHARE Application Server
[Service]
User=www-data
WorkingDirectory=/opt/sunshare
ExecStart=/opt/sunshare/.venv/bin/gunicorn --bind 0.0.0.0:8000 --workers 4 config.wsgi:application
[Install]
WantedBy=multi-user.target
```
**Post-Installation Verification**
1. Check container status: `docker compose ps`
2. Validate service health: `systemctl status sunshare`
3. Test API endpoints: `curl -I http://localhost:8000/api/healthcheck`
For troubleshooting and advanced configurations, consult the SUNSHARE technical documentation portal. Monitor disk space allocation for persistent volumes (redis_data, postgres_data) and implement log rotation through journald or dedicated logging solutions like Vector.