Replaces the inline bash -c "..." command in docker-compose with a dedicated startup.sh script that installs system packages, pip deps, and starts the server. Add custom setup steps (apt, pip, curl, etc.) in the marked section.
20 lines
1.1 KiB
Bash
20 lines
1.1 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
# ─── System packages ──────────────────────────────────────────────────────────
|
|
apt-get update -qq
|
|
apt-get install -y --no-install-recommends \
|
|
curl wget git vim nano htop procps jq less unzip
|
|
|
|
# ─── Python dependencies ──────────────────────────────────────────────────────
|
|
pip install -q -r /app/requirements.txt
|
|
|
|
# ─── Custom setup (add your own steps below) ──────────────────────────────────
|
|
# Example:
|
|
# apt-get install -y --no-install-recommends nodejs npm
|
|
# pip install -q pandas numpy
|
|
# curl -fsSL https://example.com/tool | bash
|
|
|
|
# ─── Start server ─────────────────────────────────────────────────────────────
|
|
exec python -u /app/main.py
|