Skip to content

Commit

Permalink
Merge pull request breuerfelix#89 from agusalex/master
Browse files Browse the repository at this point in the history
Fixed Client Docker container not working with instapy Firefox update
  • Loading branch information
Felix Breuer authored Oct 24, 2019
2 parents c199ab5 + 4c87271 commit 95d7635
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
25 changes: 9 additions & 16 deletions services/instapy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
FROM python:3-alpine
FROM python:3.7-slim-buster

WORKDIR /usr/instapy

COPY . .

RUN apk add --update --no-cache --virtual .build-dependencies \
python3-dev \
gcc \
musl-dev \
g++ \
libffi-dev \
libressl-dev \
&& pip3 install -r requirements.txt \
&& pip3 uninstall -y instapy-chromedriver \
&& apk del .build-dependencies
RUN sed -i "s#deb http://deb.debian.org/debian buster main#deb http://deb.debian.org/debian buster main contrib non-free#g" /etc/apt/sources.list \
&& apt-get update && apt-get install -y --no-install-recommends \
wget=1.20.1-1.1 gcc=4:8.3.0-1 g++=4:8.3.0-1 \
firefox-esr=60.8.0esr-1~deb10u1 firefoxdriver=3.14.1-1\
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install -r requirements.txt;

RUN apk --update --no-cache add \
chromium \
chromium-chromedriver

ENV CHROMEDRIVER_PATH=/usr/bin/chromedriver
CMD ["python3", "-u", "start.py"]
1 change: 0 additions & 1 deletion services/instapy/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
ident = getenv('IDENT')
config_endpoint = getenv('CONFIG')
socket_endpoint = getenv('SOCKET')
chromedriver_path = getenv('CHROMEDRIVER_PATH', None)

if not namespace or not token:
sys.exit(0)
Expand Down
2 changes: 1 addition & 1 deletion services/instapy/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
instapy
websocket-client
requests
python-dotenv
python-dotenv
4 changes: 0 additions & 4 deletions services/instapy/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
CONFIG_ENDPOINT = os.getenv('CONFIG_ENDPOINT', 'https://config.instapy.io')
SOCKET_ENDPOINT = os.getenv('SOCKET_ENDPOINT', 'wss://socket.instapy.io')
IDENT = os.getenv('IDENT')
CHROMEDRIVER_PATH = os.getenv('CHROMEDRIVER_PATH', None)

if not IDENT:
print('IDENT not provided')
Expand Down Expand Up @@ -132,7 +131,6 @@ def start(ws, data):
global IDENT
global NAMESPACE
global SETTING
global CHROMEDRIVER_PATH

ienv = os.environ.copy()
ienv['TOKEN'] = TOKEN
Expand All @@ -143,8 +141,6 @@ def start(ws, data):
ienv['SOCKET'] = SOCKET_ENDPOINT
ienv['CONFIG'] = CONFIG_ENDPOINT
ienv['IDENT'] = IDENT
if CHROMEDRIVER_PATH:
ienv['CHROMEDRIVER_PATH'] = CHROMEDRIVER_PATH

if platform.system() == 'Windows':
PROCESS = subprocess.Popen(
Expand Down

0 comments on commit 95d7635

Please sign in to comment.