Commit 12354591 by Jaime Collado

Docker integration

parent 64b0bb1f
FROM python:3.10
WORKDIR /code
RUN apt-get update -y
# We need wget to set up the PPA and xvfb to have a virtual screen and unzip to install the Chromedriver
RUN apt-get install -y wget xvfb unzip
RUN wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.106-1_amd64.deb
RUN apt install -y /tmp/chrome.deb
RUN rm /tmp/chrome.deb
# Set up Chromedriver Environment variables
ENV CHROMEDRIVER_VERSION 114.0.5735.90
ENV CHROMEDRIVER_DIR /chromedriver
RUN mkdir $CHROMEDRIVER_DIR
# Download and install Chromedriver
RUN wget -q --continue -P $CHROMEDRIVER_DIR "http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip"
RUN unzip $CHROMEDRIVER_DIR/chromedriver* -d $CHROMEDRIVER_DIR
# Put Chromedriver into the PATH
ENV PATH $CHROMEDRIVER_DIR:$PATH
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./app /code/app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
# CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "8000"]
\ No newline at end of file
Subproject commit 55783fe85fa3f48f3c60b7bef94d6c71a7550480
ScraperNoticias @ 64fb9e66
Subproject commit 64fb9e66a02a9f22caa6aff88439bc8bb39789f3
from fastapi import FastAPI, HTTPException, status
from fastapi.middleware.cors import CORSMiddleware
import schemas
from ScraperNoticias.globalScraper import GlobalScraper
from . import schemas
from .ScraperNoticias.globalScraper import GlobalScraper
# APP
app = FastAPI()
......
import uvicorn
import argparse
from api import app
from .api import app
if __name__ == '__main__':
parser = argparse.ArgumentParser()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment