Skip to content

Commit

Permalink
FIxed build scripts for testing - Added new build step for cantainer …
Browse files Browse the repository at this point in the history
…creation - Added run step
  • Loading branch information
jr-do committed Jan 2, 2024
1 parent 0a97dd3 commit 188a1c1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/devops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- name: Install dependencies
run: |
make install
python -m textblob.download_corpora
- name: Format code
run: |
make format
Expand All @@ -25,3 +26,6 @@ jobs:
- name: Test with pytest
run: |
make test
- name: Build Container
run: |
make build
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.10.13-slim-bookworm

RUN mkdir -p /app
COPY . main.py /app/
WORKDIR /app
RUN pip install -r requirements.txt
RUN python -m textblob.download_corpora
EXPOSE 8080
CMD [ "main.py" ]
ENTRYPOINT [ "python" ]
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ test:
#test
python -m pytest -vv --cov=mylib --cov=main test_*.py
build:
#build container
#build container
docker build -t deploy-fastapi .
run:
#run docker
docker run -p 127.0.0.1:8080:8080 829bb7e2aff0
deploy:
#deploy
all: install format lint test build deploy

0 comments on commit 188a1c1

Please sign in to comment.