데이터 사이언스/데이터 엔지니어링

T아카데미 - 데이터 엔지니어링 기초 (6)Google Kubernetes Engine

B1001101 2022. 5. 16. 21:30

강의영상

강의 요약

 

실습 코드

dockerfile

# Use an official Python runtime as a parent image
FROM python:3.7-slim

# Set the worrking directory to /app
WORKDIR /app

# Copy the current directory contents into the container at /app
ADD . /app

# Install any needed packages specified in requirerments.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt

# Define environment variable
ENV GOOGLE_APPLICATION_CREDENTIALS="/app/파일명.json"

# Run app.py when the coontainer launches
CMD ["python", "tweet.py"]

requirements.txt

google-cloud-pubsub==2.12.0
tweepy==4.8.0
python-dotenv==0.20.0