diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 6702033..0000000 --- a/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -version.h diff --git a/Dockerfile b/Dockerfile index 1c18c02..5038d8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM debian:latest +# build +FROM debian:latest as build WORKDIR /usr/src/app @@ -8,14 +9,24 @@ clang \ make \ libsqlite3-dev -COPY . ./ +COPY src ./src +COPY vendor ./vendor +COPY .git ./.git +COPY Makefile CMakeLists.txt version.h.in ./ RUN make -j8 -# tabledata should be copied from the host; -# clone it there before building the container -#RUN git submodule update --init --recursive +# prod +FROM debian:latest -CMD ["./bin/fusion"] +WORKDIR /usr/src/app -LABEL Name=openfusion Version=0.0.1 +RUN apt-get -y update && apt-get install -y \ +libsqlite3-dev + +COPY --from=build /usr/src/app/bin/fusion /bin/fusion +COPY sql ./sql + +CMD ["/bin/fusion"] + +LABEL Name=openfusion Version=0.0.2 diff --git a/docker-compose.yml b/docker-compose.yml index 0dae15e..57f30a2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,10 @@ services: build: context: . dockerfile: ./Dockerfile + volumes: + - ./config.ini:/usr/src/app/config.ini + - ./database.db:/usr/src/app/config.ini + - ./tdata:/usr/src/app/tdata ports: - "23000:23000" - "23001:23001"