forked from teaxyz/chai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rework db and alembic docker images (teaxyz#2)
* Use Ubuntu and Python base images * Don't mount a script volume for the db * Don't use a volume for app code in alembic * Move db creation DDL to alembic image Co-authored-by: Toby Padilla <[email protected]>
- Loading branch information
1 parent
5c50c3f
commit 0e6f931
Showing
9 changed files
with
49 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
FROM pkgxdev/pkgx:latest | ||
# WORKDIR /app | ||
|
||
# # install alembic | ||
# COPY .pkgx.yaml . | ||
# RUN dev | ||
|
||
RUN pkgx install alembic.sqlalchemy.org^1 psycopg.org/psycopg2^2 postgresql.org^16 | ||
FROM ubuntu:24.10 | ||
# RUN pkgx install alembic.sqlalchemy.org^1 psycopg.org/psycopg2^2 postgresql.org^16 | ||
RUN apt -y update && apt -y upgrade | ||
RUN apt -y install postgresql | ||
RUN apt -y install alembic | ||
RUN apt -y install python3-psycopg2 | ||
RUN apt -y install python3-sqlalchemy python3-sqlalchemy-ext | ||
COPY . . | ||
WORKDIR /alembic | ||
RUN chmod +x run_migrations.sh | ||
ENTRYPOINT ["/alembic/run_migrations.sh"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM pkgxdev/pkgx:latest | ||
RUN pkgx install python.org^3.11 astral.sh/uv^0 | ||
COPY requirements.txt . | ||
RUN CC=clang pkgx +clang@18 uv pip install -r requirements.txt --system | ||
FROM python:3 | ||
WORKDIR /usr/src/monitor | ||
COPY . . | ||
RUN pip install --no-cache-dir -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
pkgx +python.org^3.11 python -u main.py | ||
python -u main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,4 @@ | ||
FROM pkgxdev/pkgx | ||
# WORKDIR /app | ||
|
||
# gets pkgx setup | ||
# COPY .pkgx.yaml . | ||
# RUN dev | ||
|
||
# just install everything | ||
|
||
RUN pkgx install python.org^3.11 astral.sh/uv^0 postgresql.org^16 | ||
COPY requirements.txt . | ||
RUN CC=clang pkgx +clang@18 uv pip install -r requirements.txt --system | ||
FROM python:3 | ||
WORKDIR /usr/src/pipeline | ||
COPY . . | ||
RUN pip install --no-cache-dir -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# wait for db to be ready | ||
until pg_isready -h db -p 5432 -U postgres; do | ||
echo "waiting for database..." | ||
sleep 2 | ||
done | ||
|
||
# make directory structure | ||
# working_dir is /app | ||
mkdir -p data/{crates,pkgx,homebrew,npm,pypi,rubys} | ||
|
||
pkgx +python^3.11 +postgresql.org^16 python -u src/pipeline/main.py crates | ||
python -u src/pipeline/main.py crates |