Skip to content

Commit

Permalink
Merge pull request #50 from CppComet/alfa
Browse files Browse the repository at this point in the history
4.0
  • Loading branch information
VictorTrapenok authored Jun 16, 2018
2 parents c2f7b07 + 849bd1d commit a798a9c
Show file tree
Hide file tree
Showing 78 changed files with 6,934 additions and 6,220 deletions.
41 changes: 35 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,42 @@
*.dirstamp
.libs
.deps

/.idea

# CMake
/CMakeCache.txt
# CMake
*/CMakeFiles
*/CMakeFiles/*
*CMakeCache.txt
/nbproject
/nbproject/*
*Makefile*
*cmake_install*
/compile_commands*
*CMakeFiles*
/cpp_comet

/coverage/CMakeFiles
/coverage/node_modules
/coverage/CMakeCache.txt
/coverage/cmake_install.cmake
/coverage/CometQL.tab.c
/coverage/CometQL.tab.h
/coverage/lex.yy.c
/coverage/Makefile
/coverage/y.tab.c
/coverage/y.tab.h

/coverage/cppcomet_coverage

/coverage/CMakeFiles
/coverage/cov
/coverage/coverage
/coverage/node_modules
/coverage/CMakeCache.txt
/coverage/cmake_install.cmake
/coverage/CometQL.tab.c
/coverage/CometQL.tab.h
/coverage/coverage.html
/coverage/lex.yy.c
/coverage/Makefile
/coverage/posix_signal.log
/coverage/test-cov.js
/coverage/y.tab.c
/coverage/y.tab.h
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ ENDIF (MYSQL_INCLUDE_DIR)
FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
/usr/local/include/mysql
/usr/include/mysql
/usr/include/mariadb
)

SET(MYSQL_NAMES mysqlclient mysqlclient_r)
Expand Down Expand Up @@ -200,10 +201,10 @@ set(INSTALL_BIN_DIR
set(INSTALL_SYSTEMD_DIR
/etc/systemd/system)

install(FILES comet.service DESTINATION ${INSTALL_SYSTEMD_DIR})
install(FILES comet.ini DESTINATION ${INSTALL_CONF_DIR})
install(FILES comet-service.sh DESTINATION ${INSTALL_CONF_DIR})
install(TARGETS cppcomet DESTINATION ${INSTALL_BIN_DIR})
install(FILES comet.service DESTINATION ${INSTALL_SYSTEMD_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES comet.ini DESTINATION ${INSTALL_CONF_DIR} PERMISSIONS OWNER_READ GROUP_READ )
install(PROGRAMS comet-service.sh DESTINATION ${INSTALL_CONF_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
install(TARGETS cppcomet DESTINATION ${INSTALL_BIN_DIR} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)

# https://cmake.org/pipermail/cmake/2009-September/031887.html
# INSTALL(SCRIPT CopyIfNotExists.cmake)
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM debian:9
MAINTAINER [email protected]


RUN apt-get update && apt-get install --assume-yes cmake make cpp gcc libssl-dev g++ pkg-config libmariadbclient-dev-compat mysql-client flex mailutils uuid-dev git wget
RUN git clone https://github.com/CppComet/comet-server && cd comet-server && cmake . && make && make install && mkdir /var/log/cppcomet
RUN apt-get remove -y cmake make flex git cpp gcc g++ && apt-get clean

EXPOSE 8087
EXPOSE 3307
EXPOSE 3311

CMD ["/usr/bin/cppcomet"]

# You need put comet.ini file in to /etc/comet-server/comet.ini with configuration for coocomet
# Build docker with command
# docker build --tag cppcomet .
# Start docker with command
# docker run -v /var/log/cppcomet:/var/log/cppcomet -v /etc/comet-server/comet.ini:/etc/comet-server/comet.ini -p=8088:80 -p=3305:3306 -p=3316:3316 cppcomet:latest



# stop all containers:
# docker kill $(docker ps -q)

# remove all containers
# docker rm $(docker ps -a -q)

# remove all docker images
# docker rmi $(docker images -q)
38 changes: 38 additions & 0 deletions Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM debian:9
MAINTAINER [email protected]


RUN apt-get update && apt-get install --assume-yes htop nano mc cmake make cpp gcc libssl-dev g++ pkg-config libmariadbclient-dev-compat mysql-client flex mailutils uuid-dev git wget checkinstall
RUN apt-get install -y build-essential libssl-dev curl

RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs valgrind

RUN npm install websockets mysql

EXPOSE 8087
EXPOSE 3307
EXPOSE 3311

# RUN history -s "rm -rf /comet/ && cp -R /cppcomet/ /comet && cd /comet/ && rm -rf /comet/dependencies/jwt-cpp/CMakeCache.txt && rm -rf /comet/CMakeCache.txt && cmake . && make"

CMD ["/bin/bash"]

# This file used for building .deb package
# Build docker with command
# docker build --tag debian-dev -f ./Dockerfile-dev .


# Start docker with command
# docker run -v $(pwd):/cppcomet -p=8087:8087 -p=3305:3305 -p=3316:3316 -it debian-dev:latest bash



# stop all containers:
# docker kill $(docker ps -q)

# remove all containers
# docker rm $(docker ps -a -q)

# remove all docker images
# docker rmi $(docker images -q)
Loading

0 comments on commit a798a9c

Please sign in to comment.