Skip to content

Commit 3e02e99

Browse files
committed
Simplify docker build
1 parent 91a9dba commit 3e02e99

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

Dockerfile

+5-22
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
1-
FROM ubuntu:18.04
2-
3-
# From python:3.5 docker image, set locale
4-
ENV LANG C.UTF-8
1+
FROM python:3.7
52

63
VOLUME /app
74
WORKDIR /app
5+
COPY csbot ./csbot
6+
COPY csbot.*.cfg requirements.txt run_csbot.py docker-entrypoint.sh ./
87

9-
# Update base OS
10-
RUN apt-get -y update && apt-get -y upgrade
11-
# Install useful tools
12-
RUN apt-get -y install git curl
13-
# Install Python 3(.4)
14-
RUN apt-get -y install python3 python3-dev python-virtualenv
15-
# Install dependencies for Python libs
16-
RUN apt-get -y install libxml2-dev libxslt1-dev zlib1g-dev
17-
18-
# Copy needed files to build docker image
19-
ADD requirements.txt docker-entrypoint.sh ./
20-
21-
# Create virtualenv
22-
RUN virtualenv -p python3 /venv
23-
# Populate virtualenv
24-
RUN ./docker-entrypoint.sh pip install --upgrade pip
25-
RUN ./docker-entrypoint.sh pip install -r requirements.txt
8+
RUN pip install -r requirements.txt
269

2710
ENTRYPOINT ["./docker-entrypoint.sh"]
28-
CMD ["./run_csbot.py", "csbot.cfg"]
11+
CMD ["./csbot.cfg"]

docker-entrypoint.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ if [[ ! -z "$ROLLBAR_ACCESS_TOKEN" ]] ; then
88
-F local_username=`whoami`
99
fi
1010

11-
. /venv/bin/activate
12-
exec $@
11+
exec ./run_csbot.py $@

0 commit comments

Comments
 (0)