fix(deploy): ensure /root/.pry dir and volume exist for SQLite migrations #7
3 changed files with 8 additions and 6 deletions
|
|
@ -41,7 +41,7 @@ COPY routers/ ./routers/
|
||||||
COPY llm_providers/ ./llm_providers/
|
COPY llm_providers/ ./llm_providers/
|
||||||
COPY stealth_scripts/ ./stealth_scripts/
|
COPY stealth_scripts/ ./stealth_scripts/
|
||||||
COPY templates/ ./templates/
|
COPY templates/ ./templates/
|
||||||
RUN mkdir -p /app/sessions
|
RUN mkdir -p /app/sessions /root/.pry
|
||||||
|
|
||||||
EXPOSE 8002
|
EXPOSE 8002
|
||||||
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 \
|
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 \
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,15 @@ from logging.config import fileConfig
|
||||||
from sqlalchemy import engine_from_config, pool
|
from sqlalchemy import engine_from_config, pool
|
||||||
|
|
||||||
from alembic import context
|
from alembic import context
|
||||||
from db import Base
|
from db import Base, _resolve_database_url
|
||||||
|
|
||||||
config = context.config
|
config = context.config
|
||||||
|
|
||||||
if config.config_file_name is not None:
|
if config.config_file_name is not None:
|
||||||
fileConfig(config.config_file_name)
|
fileConfig(config.config_file_name)
|
||||||
|
|
||||||
db_url = os.getenv("PRY_DATABASE_URL")
|
# Always use the same URL resolution logic as the application.
|
||||||
if db_url is not None:
|
config.set_main_option("sqlalchemy.url", os.getenv("PRY_DATABASE_URL") or _resolve_database_url())
|
||||||
config.set_main_option("sqlalchemy.url", db_url)
|
|
||||||
|
|
||||||
target_metadata = Base.metadata
|
target_metadata = Base.metadata
|
||||||
exclude_tables = {"spatial_ref_sys"}
|
exclude_tables = {"spatial_ref_sys"}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,9 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:8005:8002"
|
- "127.0.0.1:8005:8002"
|
||||||
volumes:
|
volumes:
|
||||||
|
- pry-data:/root/.pry
|
||||||
- pry-sessions:/app/sessions
|
- pry-sessions:/app/sessions
|
||||||
|
env_file: .env
|
||||||
environment:
|
environment:
|
||||||
- PYTHONUNBUFFERED=1
|
- PYTHONUNBUFFERED=1
|
||||||
- PRY_TIMEOUT=60
|
- PRY_TIMEOUT=60
|
||||||
|
|
@ -44,7 +46,7 @@ services:
|
||||||
container_name: pry-flaresolverr
|
container_name: pry-flaresolverr
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:8191:8191"
|
- "127.0.0.1:8192:8191"
|
||||||
environment:
|
environment:
|
||||||
- LOG_LEVEL=info
|
- LOG_LEVEL=info
|
||||||
- CAPTCHA_SOLVER=none
|
- CAPTCHA_SOLVER=none
|
||||||
|
|
@ -76,4 +78,5 @@ services:
|
||||||
- tor
|
- tor
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
pry-data:
|
||||||
pry-sessions:
|
pry-sessions:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue