Skip to content

Instantly share code, notes, and snippets.

Created August 12, 2017 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/302350e58ceb9e859d626d0728ddf287 to your computer and use it in GitHub Desktop.
Save anonymous/302350e58ceb9e859d626d0728ddf287 to your computer and use it in GitHub Desktop.
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