Skip to content

Commit

Permalink
add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
taohex committed Sep 12, 2017
1 parent c5a7928 commit daf99ac
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ bin/
lib/
build/

# Protocol Buffers
*.pb.cc
*.pb.h

# Prerequisites
*.d

Expand Down
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM buildpack-deps:zesty

COPY . /phxqueue

RUN apt-get update \
&& apt-get install -y cmake --no-install-recommends \
&& cd /phxqueue \
&& ./build.sh \
&& apt-get purge -y --auto-remove cmake

WORKDIR /phxqueue

ENV PATH="/phxqueue/bin:$PATH"

COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]

#EXPOSE 5100 5200 5300

#VOLUME /data

1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ git submodule update --init --recursive
(cd third_party && bash ./autoinstall.sh)

make

27 changes: 27 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -x
ulimit -Sn 4096
ulimit -n 4096

cd /phxqueue/
bin/store_main -d -c etc/store_server.0.conf
bin/store_main -d -c etc/store_server.1.conf
bin/store_main -d -c etc/store_server.2.conf
bin/consumer_main -d -c etc/consumer_server.0.conf
bin/consumer_main -d -c etc/consumer_server.1.conf
bin/consumer_main -d -c etc/consumer_server.2.conf
bin/lock_main -d -c etc/lock_server.0.conf
bin/lock_main -d -c etc/lock_server.1.conf
bin/lock_main -d -c etc/lock_server.2.conf
bin/scheduler_main -d -c etc/scheduler_server.0.conf
bin/scheduler_main -d -c etc/scheduler_server.1.conf
bin/scheduler_main -d -c etc/scheduler_server.2.conf

#ps -ef | grep store_main
#ps -ef | grep lock_main
#ps -ef | grep scheduler_main
#ps -ef | grep consumer_main

exec tail -f /dev/null

0 comments on commit daf99ac

Please sign in to comment.