1
0
Fork 0

Creado Dockerfile

This commit is contained in:
Parodper 2023-12-31 18:21:32 +01:00
parent 15469677e5
commit 7502ba09b7
4 changed files with 25 additions and 3 deletions

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM python:3.11-alpine
WORKDIR /
#RUN git clone https://git.disroot.org/parodper/comparar_guias_docentes.git
COPY . /comparar_guias_docentes
WORKDIR /comparar_guias_docentes
RUN pip install html2text bs4 requests
RUN chmod 0500 serve.py main.py

View File

@ -6,9 +6,9 @@ Programa para comparar guías docentes de distintos anos
Dependencias:
* html2text (2020.1.16)
* html2text (probado con 2020.1.16)
* bs4 (probado con 4.12.2/bs4==0.0.1)
* requests (2.31.0)
* requests (probado con 2.31.0)
## Uso

12
docker-compose.yml Normal file
View File

@ -0,0 +1,12 @@
version: '3'
services:
comparar_guias_docentes:
build:
context: .
dockerfile: Dockerfile
volumes:
- ./cache:/comparar_guias_docentes/cache
- ./out:/comparar_guias_docentes/out
command: ./serve.py 0.0.0.0 80
ports:
- 8080:80

View File

@ -55,8 +55,9 @@ class ServidorIPv6(HTTPServer):
if __name__ == '__main__':
try:
ops = (sys.argv[1], int(sys.argv[2]))
logging.info(f'Executando servidor en {ops[0]}:{ops[1]}')
httpd = HTTPServer(ops, ServidorHTTP) \
if type(ipaddress.ip_address(sys.argv[1])) != ipaddress.IPv6Address \
if type(ipaddress.ip_address(ops[0])) != ipaddress.IPv6Address \
else ServidorIPv6(ops, ServidorHTTP)
httpd.serve_forever()
except IndexError: