Skip to content

Commit 286425c

Browse files
committed
update all in flask
1 parent a080274 commit 286425c

21 files changed

+7419
-7364
lines changed

.github/workflows/ci-cd.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docker Image CI-CD
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.x'
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v2
25+
26+
- name: Cache Docker layers
27+
uses: actions/cache@v3
28+
with:
29+
path: /tmp/.buildx-cache
30+
key: ${{ runner.os }}-buildx-${{ github.sha }}
31+
restore-keys: |
32+
${{ runner.os }}-buildx-
33+
34+
- name: Build Docker image
35+
run: docker build -t email-classifier .
36+
37+
- name: Test the application (Run tests inside container)
38+
run: docker run --rm email-classifier pytest tests/

.github/workflows/python-package-conda.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM python:3.11
2+
3+
# Install required packages
4+
RUN pip install nltk
5+
6+
# Download nltk data (punkt)
7+
RUN python -m nltk.downloader punkt
8+
9+
# Set the working directory
10+
WORKDIR /app
11+
12+
# Copy the current directory contents into the container
13+
COPY . /app
14+
15+
# Install the dependencies
16+
RUN pip install --no-cache-dir -r requirements.txt
17+
18+
# Expose the port Flask runs on
19+
EXPOSE 5000
20+
21+
# Command to run the Flask app
22+
CMD ["python", "app.py"]

0 commit comments

Comments
 (0)