-
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.
remove db - moved db to sales-db repo
- Loading branch information
Showing
28 changed files
with
60 additions
and
415,626 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: docker/setup-buildx-action@v2 | ||
|
||
- uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
cache-from: hexletcomponents/data-charts-api:latest | ||
cache-to: type=inline | ||
tags: hexletcomponents/data-charts-api:latest |
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,14 +1,10 @@ | ||
FROM postgres:latest | ||
FROM python:slim | ||
|
||
WORKDIR /scripts | ||
RUN apt-get update && apt-get install -yqq make | ||
RUN pip install poetry | ||
ENV POETRY_VIRTUALENVS_IN_PROJECT=true | ||
|
||
COPY db/data_generator/data /scripts/data | ||
COPY setup_user.sql /scripts/ | ||
COPY scripts/ /scripts/db | ||
|
||
|
||
RUN cat /scripts/db/*.sql > /tmp/chartsdb.sql | ||
|
||
RUN echo "createdb chartsdb" >> /docker-entrypoint-initdb.d/run.sh | ||
RUN echo "psql -d chartsdb -U postgres -f /tmp/chartsdb.sql" >> /docker-entrypoint-initdb.d/run.sh | ||
RUN echo "psql -d chartsdb -U postgres -f /scripts/setup_user.sql" >> /docker-entrypoint-initdb.d/run.sh | ||
WORKDIR /app | ||
COPY . . | ||
RUN poetry install |
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,28 +1,21 @@ | ||
dev: | ||
poetry run flask --app app.server run --debug -h 0.0.0.0 -p 3000 | ||
|
||
run: | ||
poetry run gunicorn -w 4 -b 0.0.0.0:3000 app.server:app | ||
|
||
start: | ||
make stop rm || true | ||
docker run -it \ | ||
-p 5432:5432 \ | ||
-e POSTGRES_PASSWORD=password \ | ||
--name data-chartsdb \ | ||
data-chartsdb | ||
docker run -p 3000:3000 app-chartsdb make run | ||
|
||
build: | ||
docker build . -t data-chartsdb | ||
docker build . -t app-chartsdb | ||
|
||
stop: | ||
docker stop data-chartsdb | ||
docker stop app-chartsdb | ||
|
||
rm: | ||
docker rm data-chartsdb | ||
docker rm app-chartsdb | ||
|
||
bash: | ||
docker run --rm -it data-chartsdb bash | ||
|
||
compose: | ||
docker compose up | ||
|
||
compose-build: | ||
docker compose build | ||
|
||
compose-down: | ||
docker compose down -v --remove-orphans | ||
docker run --rm -it app-chartsdb bash |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.