Fix deploy

This commit is contained in:
Mootfrost777 2025-04-11 11:04:49 +03:00
parent 02052ac7ac
commit 02dbe341c9
3 changed files with 23 additions and 9 deletions

5
.gitignore vendored
View file

@ -11,8 +11,9 @@ wheels/
# other
.idea
.env
.env*
*.session
*.session-journal
oauth.json
resp.json
resp.json
pgdata

View file

@ -12,11 +12,12 @@ RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project
ADD ./app /app/app
ADD uv.lock /app/
ADD pyproject.toml /app/
ADD ./alembic /app/alembic
ADD alembic.ini /app
COPY ./app /app/app
COPY uv.lock /app/
COPY pyproject.toml /app/
COPY ./alembic /app/alembic
COPY alembic.ini /app
COPY oauth.json /app/
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-editable
@ -30,4 +31,5 @@ RUN apk add --no-cache ffmpeg
COPY --from=builder --chown=app:app /app /app
ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONPATH="/app"
WORKDIR /app

View file

@ -4,7 +4,7 @@ services:
image: nowplaybot
build: .
env_file:
- .env
- .env.production
restart: unless-stopped
command: >
sh -c "ls && python -m alembic upgrade head && python app/__main__.py"
@ -13,9 +13,20 @@ services:
callback_listener:
<<: *bot
ports:
- 8080:8080
- "8080:8080"
labels:
- traefik.enable=true
- traefik.http.routers.music_mootfrost_dev.rule=Host(`music.mootfrost.dev`)
- traefik.http.services.music_mootfrost_dev.loadbalancer.server.port=8080
command: python app/callback_listener.py
db:
image: postgres:17.4-alpine
volumes:
- ./pgdata:/var/lib/postgresql/data/pgdata
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: owl
POSTGRES_DB: nowplaybot
PGDATA: /var/lib/postgresql/data/pgdata