-
-
Save reatlat/d0ac28d06cf28c7da99dbf9ddd84e2d3 to your computer and use it in GitHub Desktop.
example Dockerfile for Python app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
app_name: | |
build: . | |
command: > | |
bash -c "python3 /src/example.py" | |
env_file: | |
- .env | |
volumes: | |
- .:/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:bionic | |
MAINTAINER Alex Zappa <alex@zappa.dev> | |
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y update && apt-get -y install tzdata | |
RUN echo "Spain/Madrid" | tee /etc/timezone | |
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y update && \ | |
apt-get install -q -y \ | |
python3 python3-pip \ | |
fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 \ | |
libnspr4 libnss3 lsb-release xdg-utils libxss1 libdbus-glib-1-2 \ | |
curl unzip wget \ | |
x11vnc xvfb fluxbox wmctrl | |
# install geckodriver and firefox | |
RUN GECKODRIVER_VERSION=`curl https://github.com/mozilla/geckodriver/releases/latest | grep -Po 'v[0-9]+.[0-9]+.[0-9]+'` && \ | |
wget https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz && \ | |
tar -zxf geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz -C /usr/local/bin && \ | |
chmod +x /usr/local/bin/geckodriver && \ | |
rm geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz | |
RUN FIREFOX_SETUP=firefox-setup.tar.bz2 && \ | |
apt-get purge firefox && \ | |
wget -O $FIREFOX_SETUP "https://download.mozilla.org/?product=firefox-latest&os=linux64" && \ | |
tar xjf $FIREFOX_SETUP -C /opt/ && \ | |
ln -s /opt/firefox/firefox /usr/bin/firefox && \ | |
rm $FIREFOX_SETUP | |
# install chromedriver and google-chrome | |
#RUN CHROMEDRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` #&& \ | |
# wget https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/#chromedriver_linux64.zip && \ | |
# unzip chromedriver_linux64.zip -d /usr/bin && \ | |
# chmod +x /usr/bin/chromedriver && \ | |
# rm chromedriver_linux64.zip | |
#RUN CHROME_SETUP=google-chrome.deb && \ | |
# wget -O $CHROME_SETUP "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" #&& \ | |
# dpkg -i $CHROME_SETUP && \ | |
# apt-get install -y -f && \ | |
# rm $CHROME_SETUP | |
#FROM python:3.6.9 | |
WORKDIR /src | |
COPY ./requirements.txt . | |
RUN pip3 install -r requirements.txt | |
COPY . . | |
#CMD ["bash","example.sh", "start"] | |
CMD ["python3","example.py"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment