Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3.8"
services:
nixopus-test-db:
image: postgres:14-alpine
container_name: nixopus-test-db-container
container_name: nixopus-test-db
ports:
- "${TEST_DB_PORT:-5433}:5432"
restart: unless-stopped
Expand Down
58 changes: 13 additions & 45 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,28 @@ version: "3.8"
services:
nixopus-api:
image: ghcr.io/${GITHUB_REPOSITORY:-raghavyuva/nixopus}-api:latest
container_name: nixopus-api-container
container_name: nixopus-api
ports:
- "${API_PORT:-8443}:${API_PORT:-8443}"
restart: unless-stopped
env_file:
- /etc/nixopus/source/api/.env
- ${NIXOPUS_HOME:-/etc/nixopus}/source/api/.env
environment:
- HOST_NAME=nixopus-db
volumes:
- ./logs:/app/logs
- ${DOCKER_CERT_PATH:-/etc/nixopus/docker-certs}:/etc/nixopus/docker-certs
- ${SSH_PRIVATE_KEY:-/etc/nixopus/ssh/id_rsa}:/etc/nixopus/ssh/id_rsa
- ${MOUNT_PATH:-/etc/nixopus/configs}:/etc/nixopus/configs
- ${NIXOPUS_HOME:-/etc/nixopus}:/etc/nixopus
- /var/run/docker.sock:/var/run/docker.sock
- /etc/nixopus/source/api/.env:/app/.env
- ${NIXOPUS_HOME:-/etc/nixopus}/source/api/.env:/app/.env
networks:
- nixopus-network
depends_on:
nixopus-db:
condition: service_healthy

nixopus-redis:
image: redis:7-alpine
container_name: nixopus-redis-container
restart: unless-stopped
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- ${REDIS_VOLUME:-/etc/nixopus/redis}:/data
command: redis-server --appendonly yes
networks:
- nixopus-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5

nixopus-db:
image: postgres:14-alpine
container_name: nixopus-db-container
container_name: nixopus-db
restart: unless-stopped
environment:
- POSTGRES_USER=${USERNAME}
Expand All @@ -53,7 +34,7 @@ services:
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- ${DB_VOLUME:-/etc/nixopus/db}:/var/lib/postgresql/data
- ${NIXOPUS_HOME:-/etc/nixopus}/db:/var/lib/postgresql/data
networks:
- nixopus-network
healthcheck:
Expand All @@ -62,47 +43,34 @@ services:
timeout: 5s
retries: 5

# nixopus-test-db:
# image: postgres:14-alpine
# container_name: nixopus-test-db-container
# ports:
# - "${TEST_DB_PORT:-5433}:5432"
# restart: unless-stopped
# environment:
# - POSTGRES_USER=${TEST_DB_USERNAME:-nixopus}
# - POSTGRES_PASSWORD=${TEST_DB_PASSWORD:-nixopus}
# - POSTGRES_DB=${TEST_DB_NAME:-nixopus_test}
# networks:
# - nixopus-network

nixopus-view:
image: ghcr.io/${GITHUB_REPOSITORY:-raghavyuva/nixopus}-view:latest
container_name: nixopus-view-container
container_name: nixopus-view
build:
args:
- NEXT_PUBLIC_PORT=${NEXT_PUBLIC_PORT}
ports:
- "${NEXT_PUBLIC_PORT:-7443}:${NEXT_PUBLIC_PORT:-7443}"
restart: unless-stopped
env_file:
- /etc/nixopus/source/view/.env
- ${NIXOPUS_HOME:-/etc/nixopus}/source/view/.env
volumes:
- ./logs:/app/logs
- /etc/nixopus/source/view/.env:/app/.env
- ${NIXOPUS_HOME:-/etc/nixopus}/source/view/.env:/app/.env
networks:
- nixopus-network

nixopus-caddy:
image: caddy:latest
container_name: nixopus-caddy-container
container_name: nixopus-caddy
ports:
- "2019:2019"
- "80:80"
- "443:443"
volumes:
- /etc/nixopus/source/helpers/Caddyfile:/etc/caddy/Caddyfile
- ${CADDY_DATA_VOLUME:-/etc/nixopus/caddy}:/data
- ${CADDY_CONFIG_VOLUME:-/etc/nixopus/caddy}:/config
- ${NIXOPUS_HOME:-/etc/nixopus}/source/helpers/Caddyfile:/etc/caddy/Caddyfile
- ${NIXOPUS_HOME:-/etc/nixopus}/caddy:/data
- ${NIXOPUS_HOME:-/etc/nixopus}/caddy:/config
command:
[
"caddy",
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ Create specialized image variants:
time docker-compose up -d api

# Check resource usage
docker stats nixopus-api-container
docker stats nixopus-api
```

3. **Security Scanning**
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/self-hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ When enhancing the installation process:
self._stop_services()

print(f"Restoring database from {backup_path}...")
container_name = "nixopus-db-container"
container_name = "nixopus-db"
command = [
"docker", "exec", "-i", container_name,
"pg_restore", "-U", "nixopus", "-d", "nixopus",
Expand Down
4 changes: 2 additions & 2 deletions helpers/config.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ services:
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_VOLUME: ${REDIS_VOLUME:-./redis}
REDIS_IMAGE: ${REDIS_IMAGE:-redis:7-alpine}
REDIS_CONTAINER_NAME: ${REDIS_CONTAINER_NAME:-nixopus-redis-container}
REDIS_CONTAINER_NAME: ${REDIS_CONTAINER_NAME:-nixopus-redis}

db:
env:
DB_PORT: ${DB_PORT:-5432}
DB_VOLUME: ${DB_VOLUME:-./db}
DB_IMAGE: ${DB_IMAGE:-postgres:14-alpine}
DB_CONTAINER_NAME: ${DB_CONTAINER_NAME:-nixopus-db-container}
DB_CONTAINER_NAME: ${DB_CONTAINER_NAME:-nixopus-db}
POSTGRES_USER: ${USERNAME:-postgres}
POSTGRES_PASSWORD: ${PASSWORD:-changeme}
POSTGRES_DB: ${DB_NAME:-postgres}
Expand Down
10 changes: 5 additions & 5 deletions helpers/config.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:
API_ENV_FILE: ${API_ENV_FILE:-/etc/nixopus/source/api/.env}
API_VOLUME: ${API_VOLUME:-/etc/nixopus/configs}
API_IMAGE: ${API_IMAGE:-ghcr.io/raghavyuva/nixopus-api:latest}
API_CONTAINER_NAME: ${API_CONTAINER_NAME:-nixopus-api-container}
API_CONTAINER_NAME: ${API_CONTAINER_NAME:-nixopus-api}
DOCKER_PORT: ${DOCKER_PORT:-2376}
APP_VERSION: ${APP_VERSION:-0.1.0-alpha.11}
view:
Expand All @@ -37,21 +37,21 @@ services:
LOGS_PATH: ${LOGS_PATH:-./logs}
VIEW_ENV_FILE: ${VIEW_ENV_FILE:-/etc/nixopus/source/view/.env}
VIEW_IMAGE: ${VIEW_IMAGE:-ghcr.io/raghavyuva/nixopus-view:latest}
VIEW_CONTAINER_NAME: ${VIEW_CONTAINER_NAME:-nixopus-view-container}
VIEW_CONTAINER_NAME: ${VIEW_CONTAINER_NAME:-nixopus-view}

redis:
env:
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_VOLUME: ${REDIS_VOLUME:-/etc/nixopus/redis}
REDIS_IMAGE: ${REDIS_IMAGE:-redis:7-alpine}
REDIS_CONTAINER_NAME: ${REDIS_CONTAINER_NAME:-nixopus-redis-container}
REDIS_CONTAINER_NAME: ${REDIS_CONTAINER_NAME:-nixopus-redis}

db:
env:
DB_PORT: ${DB_PORT:-5432}
DB_VOLUME: ${DB_VOLUME:-/etc/nixopus/db}
DB_IMAGE: ${DB_IMAGE:-postgres:14-alpine}
DB_CONTAINER_NAME: ${DB_CONTAINER_NAME:-nixopus-db-container}
DB_CONTAINER_NAME: ${DB_CONTAINER_NAME:-nixopus-db}
POSTGRES_USER: ${USERNAME:-postgres}
POSTGRES_PASSWORD: ${PASSWORD:-changeme}
POSTGRES_DB: ${DB_NAME:-postgres}
Expand All @@ -60,7 +60,7 @@ services:
caddy:
env:
CADDY_IMAGE: ${CADDY_IMAGE:-caddy:latest}
CADDY_CONTAINER_NAME: ${CADDY_CONTAINER_NAME:-nixopus-caddy-container}
CADDY_CONTAINER_NAME: ${CADDY_CONTAINER_NAME:-nixopus-caddy}
CADDY_DATA_VOLUME: ${CADDY_DATA_VOLUME:-/etc/nixopus/caddy}
CADDY_CONFIG_VOLUME: ${CADDY_CONFIG_VOLUME:-/etc/nixopus/caddy}
CADDY_PORTS: "2019:2019,80:80,443:443"
Expand Down
Loading