From b248a4c766681ce569e5fc539d8a42020617372a Mon Sep 17 00:00:00 2001 From: itismadness Date: Tue, 22 Jun 2021 19:34:10 +0000 Subject: [PATCH] improve dev workflow (cherry picked from commit 50a08a2b66a6444093a47d5407d836537ebe3206) --- .gitignore | 1 + Dockerfile | 31 ++++++++++++++++++------------- README.md | 7 +++++++ 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 73d75a3..ee6689f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ +.vscode/ .vagrant/ *.tar.* MakeFile.in diff --git a/Dockerfile b/Dockerfile index 2b32d08..80f46fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,5 @@ FROM debian:stretch-slim -COPY . /srv -WORKDIR /srv - RUN apt-get update \ && apt-get install --no-install-recommends -y \ build-essential \ @@ -13,19 +10,27 @@ RUN apt-get update \ libev-dev \ libjemalloc-dev \ libmysql++-dev \ - pkg-config \ - && mkdir build \ + pkg-config + +COPY . /srv +WORKDIR /srv + +RUN mkdir build \ && cd build \ && cmake .. \ && make \ - && apt-get purge -y \ - build-essential \ - cmake \ - pkg-config \ - && apt-get autoremove -y \ - && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* \ && mv /srv/build/ocelot /srv/ocelot \ && mv /srv/ocelot.conf.dist /srv/ocelot.conf -CMD ["/srv/ocelot"] \ No newline at end of file +RUN apt-get purge -y \ + build-essential \ + cmake \ + pkg-config \ + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + +# default listen_port value in ocelot.conf +EXPOSE 34000 + +CMD ["/srv/ocelot"] diff --git a/README.md b/README.md index 1c3a993..b22339a 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,13 @@ make The [Gazelle installation guides](https://github.com/WhatCD/Gazelle/wiki/Gazelle-installation) include instructions for installing Ocelot as a part of the Gazelle project. +### Docker + +```bash +docker build . -t ocelot +docker run -v $(pwd)/ocelot.conf:/srv/ocelot.conf ocelot +``` + ### Standalone Installation * Create the following tables according to the [Gazelle database schema](https://raw.githubusercontent.com/WhatCD/Gazelle/master/gazelle.sql):