diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4269db1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM python +WORKDIR /fast-api +COPY ./requirments.txt/fast-api/ +RUN pip install --no-cache-dir --upgrade -r /fast-api/requirements.txt +COPY . /fast-api +RUN mkdir -p /fast-api/data +CMD ["uvicorn","app.main:app", "--host", "0.0.0.0","--port","8000"] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..879619c --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,16 @@ +pipeline { + agent any + stages{ + stage('Checkout') { + steps { + checkout scm + } + } + stage('Build') { + steps { + sh 'docker compose up --build -d --no-cache' + } + } + } + } + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6150ae9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3.8' +services: + fast_api: + build: + ports: + - '8000:8000' + command: uvicorn app.main:app --host 0.0.0.0 --port 8000 + +