Added basic file layout, dockerfile and docker-compose.yml

This commit is contained in:
Carlos Sousa
2021-04-30 13:16:40 +02:00
parent cfe95825bc
commit eaf30aa206
4 changed files with 48 additions and 0 deletions

10
Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM python:3.9-alpine3.13
WORKDIR /opt/imdbscrapper
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY src/ .
CMD ["python", "-u", "/opt/imdbscrapper/scrapper.py"]

16
docker-compose.yml Normal file
View File

@@ -0,0 +1,16 @@
version: '3'
services:
tornStocks:
container_name: imdbscrapper
image: zebrajr/imdbscrapper:latest
#ports:
# - '80:8080'
# - '443:8443'
volumes:
- '${PWD}/src:/opt/imdbscrapper:ro'
#web:
# build: .
# command: python manage.py runserver 0.0.0.0:8000
# ports:
# - "8000:8000"

2
requirements.txt Normal file
View File

@@ -0,0 +1,2 @@
beautifulsoup4
requests

20
src/scrapper.py Normal file
View File

@@ -0,0 +1,20 @@
import os
import time
import json
import requests
from bs4 import BeautifulSoup
def cls():
os.system('cls' if os.name=='nt' else 'clear')
def main():
cls()
print("Hey2")
if __name__ == "__main__":
main()