Created
August 12, 2017 21:54
-
-
Save anonymous/302350e58ceb9e859d626d0728ddf287 to your computer and use it in GitHub Desktop.
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:16.04 | |
ENV HOME /root | |
WORKDIR /root | |
RUN apt-get update -qq | |
RUN apt-get install locales | |
RUN locale-gen en_US.UTF-8 | |
ENV LANG en_US.UTF-8 | |
ENV LANGUAGE en_US:en | |
ENV LC_ALL en_US.UTF-8 | |
RUN \ | |
apt-get -y upgrade -qq && \ | |
apt-get install -y -qq build-essential cmake gcc libcunit1-dev libudev-dev && \ | |
apt-get install -y -qq curl git unzip wget && \ | |
apt-get install -y -qq python3-pip && \ | |
apt-get install -y -qq sysfsutils && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN \ | |
cd /tmp && \ | |
wget http://download.redis.io/redis-stable.tar.gz && \ | |
tar xvzf redis-stable.tar.gz && \ | |
cd redis-stable && \ | |
make && \ | |
make install && \ | |
cp -f src/redis-sentinel /usr/local/bin && \ | |
mkdir -p /etc/redis && \ | |
cp -f *.conf /etc/redis && \ | |
rm -rf /tmp/redis-stable* && \ | |
sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf && \ | |
sed -i 's/^\(daemonize .*\)$/# \1/' /etc/redis/redis.conf && \ | |
echo "kernel/mm/transparent_hugepage/enabled = never" >> /etc/sysfs.conf && \ | |
echo "kernel/mm/transparent_hugepage/enabled = never" >> /etc/rc.local | |
WORKDIR /root | |
RUN \ | |
pip3 install -U pip && \ | |
pip3 install git+https://github.com/channelcat/sanic && \ | |
pip3 install aioredis && \ | |
pip3 install numpy | |
ADD main.py $HOME | |
ADD data.zip $HOME | |
EXPOSE 6379 | |
EXPOSE 80 | |
CMD ["redis-server", "/etc/redis/redis.conf"] | |
CMD ["python3", "main.py"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment