mirror of
https://github.com/altstackHQ/altstack-data.git
synced 2026-04-23 17:25:14 +02:00
🤖 Sentinel: Synchronization from aa-humaaan/thealtstack
This commit is contained in:
46
docker-deploy/appflowy/Dockerfile
Normal file
46
docker-deploy/appflowy/Dockerfile
Normal file
@@ -0,0 +1,46 @@
|
||||
# Production Dockerfile for AppFlowy
|
||||
# Based on Rust and Flutter/Web requirements.
|
||||
# Stage 1: Build
|
||||
FROM rust:1.75-slim-bookworm AS builder
|
||||
|
||||
# Install build dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
pkg-config \
|
||||
libssl-dev \
|
||||
git \
|
||||
cmake \
|
||||
clang \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
|
||||
# Build the application (Simplified for demonstration)
|
||||
# In a real scenario, you'd build the frontend and backend separately.
|
||||
# RUN cargo build --release
|
||||
|
||||
# Stage 2: Runtime
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
# Create non-root user
|
||||
RUN groupadd -r appuser && useradd -r -g appuser appuser
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
ca-certificates \
|
||||
libssl3 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy build artifacts from builder stage (Adjust paths as needed)
|
||||
# COPY --from=builder /app/target/release/appflowy-cloud .
|
||||
|
||||
# Set permissions
|
||||
RUN chown -R appuser:appuser /app
|
||||
|
||||
USER appuser
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["./appflowy-cloud"]
|
||||
65
docker-deploy/appflowy/docker-compose.yml
Normal file
65
docker-deploy/appflowy/docker-compose.yml
Normal file
@@ -0,0 +1,65 @@
|
||||
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
# 🚀 BUILT & MAINTAINED BY THE ALTSTACK
|
||||
# 🌍 https://thealtstack.com
|
||||
# 💡 Open-source deployment templates for modern self-hosting.
|
||||
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
|
||||
# Docker Compose for AppFlowy Cloud
|
||||
|
||||
services:
|
||||
appflowy:
|
||||
image: appflowyinc/appflowy_cloud:latest
|
||||
container_name: appflowy-cloud
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:${POSTGRES_PASSWORD:-password}@db:5432/appflowy
|
||||
- REDIS_URL=redis://redis:6379
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- appflowy_net
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:8080/health" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
container_name: appflowy-db
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
|
||||
POSTGRES_DB: appflowy
|
||||
volumes:
|
||||
- appflowy_db_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- appflowy_net
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: appflowy-redis
|
||||
networks:
|
||||
- appflowy_net
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "ping" ]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
appflowy_net:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
appflowy_db_data:
|
||||
name: appflowy_db_data
|
||||
102
docker-deploy/appflowy/install.sh
Executable file
102
docker-deploy/appflowy/install.sh
Executable file
@@ -0,0 +1,102 @@
|
||||
#!/bin/bash
|
||||
# 🚀 Auto-generated by The AltStack
|
||||
# https://thealtstack.com
|
||||
|
||||
echo "🔵 Starting AltStack Deployment..."
|
||||
|
||||
# 1. Check/Install Docker
|
||||
if ! command -v docker &> /dev/null; then
|
||||
echo "📦 Docker not found. Installing..."
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
sh get-docker.sh
|
||||
rm get-docker.sh
|
||||
echo "✅ Docker installed."
|
||||
else
|
||||
echo "✅ Docker is already installed."
|
||||
fi
|
||||
|
||||
# 2. Setup Directory
|
||||
APP_DIR="appflowy-deploy"
|
||||
mkdir -p $APP_DIR
|
||||
cd $APP_DIR
|
||||
echo "📂 Created directory: $APP_DIR"
|
||||
|
||||
# 3. Create docker-compose.yml
|
||||
echo "📄 Writing configuration..."
|
||||
cat << 'INNER_EOF' > docker-compose.yml
|
||||
# -------------------------------------------------------------------------
|
||||
# 🚀 Created and distributed by The AltStack
|
||||
# 🌍 https://thealtstack.com
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# Docker Compose for AppFlowy Cloud
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
appflowy:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: appflowy-cloud
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:${POSTGRES_PASSWORD:-password}@db:5432/appflowy
|
||||
- REDIS_URL=redis://redis:6379
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- appflowy_net
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:8080/health" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
container_name: appflowy-db
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
|
||||
POSTGRES_DB: appflowy
|
||||
volumes:
|
||||
- appflowy_db_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- appflowy_net
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: appflowy-redis
|
||||
networks:
|
||||
- appflowy_net
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "ping" ]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
appflowy_net:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
appflowy_db_data:
|
||||
name: appflowy_db_data
|
||||
|
||||
INNER_EOF
|
||||
|
||||
# 4. Start Services
|
||||
echo "🚀 Starting services..."
|
||||
docker compose up -d
|
||||
|
||||
echo ""
|
||||
echo "✅ Deployment Complete!"
|
||||
echo "👉 Your appflowy stack is running."
|
||||
Reference in New Issue
Block a user