build init.py on docker
This commit is contained in:
parent
d1d07e5c47
commit
34dfb19ddc
29
Dockerfile
29
Dockerfile
@ -1,14 +1,27 @@
|
||||
# Nasz obraz będzie dzidziczył z obrazu Ubuntu w wersji latest
|
||||
# Latest Ubuntu as starter
|
||||
FROM ubuntu:latest
|
||||
|
||||
# Instalujemy niezbędne zależności. Zwróć uwagę na flagę "-y" (assume yes)
|
||||
RUN apt update && apt install -y figlet
|
||||
# Install required dependencies
|
||||
RUN apt update
|
||||
RUN export PATH=”$PATH:/usr/local/bin/python”
|
||||
RUN apt install python3-pip -y
|
||||
RUN apt install unzip -y
|
||||
RUN pip install kaggle
|
||||
RUN pip install pandas
|
||||
RUN pip install scikit-learn
|
||||
RUN pip install matplotlib
|
||||
RUN mkdir ~/.kaggle/
|
||||
RUN echo '{"username":"wirus006","key":"c3323e37d3f91a0914d0172ef3c7c30c"}' > ~/.kaggle/kaggle.json
|
||||
|
||||
# Stwórzmy w kontenerze (jeśli nie istnieje) katalog /app i przejdźmy do niego (wszystkie kolejne polecenia RUN, CMD, ENTRYPOINT, COPY i ADD będą w nim wykonywane)
|
||||
# Create app directory in image
|
||||
WORKDIR /app
|
||||
|
||||
# Skopiujmy nasz skrypt do katalogu /app w kontenerze
|
||||
COPY ./figlet-loop.sh ./app
|
||||
# Copy init dataset script to /app directory in image
|
||||
COPY ./init.py ./
|
||||
|
||||
# Domyślne polecenie, które zostanie uruchomione w kontenerze po jego starcie
|
||||
CMD ./figlet-loop.sh
|
||||
# Download kaggle dataset
|
||||
RUN kaggle datasets download -d hakeem/atp-and-wta-tennis-data
|
||||
RUN unzip -o atp-and-wta-tennis-data.zip
|
||||
|
||||
# Script executed after docker run
|
||||
CMD python3 ./init.py
|
||||
|
4
init.py
4
init.py
@ -10,10 +10,6 @@ import matplotlib
|
||||
file_exists = exists('./df_atp.csv')
|
||||
|
||||
if not file_exists:
|
||||
subprocess.run(["pip", "install", "--user", "kaggle"])
|
||||
subprocess.run(["pip", "install", "--user", "pandas"])
|
||||
subprocess.run(["pip", "install", "--user", "scikit-learn"])
|
||||
# subprocess.run(["pip", "install", "--user", "matplotlib"])
|
||||
subprocess.run(["kaggle", "datasets", "download", "-d", "hakeem/atp-and-wta-tennis-data"])
|
||||
subprocess.run(["unzip", "-o", "atp-and-wta-tennis-data.zip"])
|
||||
|
||||
|
54909
result.csv
Normal file
54909
result.csv
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user