Docker improvements (#274)

This commit is contained in:
Gent Semaj 2024-05-07 20:11:14 -07:00 committed by GitHub
parent fa8c1e73d1
commit 54327b0c23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 8 deletions

View File

@ -1 +0,0 @@
version.h

View File

@ -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

View File

@ -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"