6 Commits

Author SHA1 Message Date
Juansecu
a52e508547 Merge 7a3c8d0071 into 233d21ecd7 2024-05-11 22:25:29 +00:00
Juansecu
7a3c8d0071 CI - Modify Push Docker Image action to build and push Docker image to linux/amd64 and linux/arm64 architectures 2024-05-11 17:25:06 -05:00
Juansecu
3bb1148cd2 BUILD - Reduce size of image by using slim version of Debian 2024-05-11 00:04:52 -05:00
Juansecu
a7d745a218 CD - Add GitHub Action to push Docker image to Docker Hub 2024-05-08 19:03:19 -05:00
CakeLancelot
233d21ecd7 Fix copy/paste error in docker-compose.yml 2024-05-07 23:01:09 -05:00
Gent Semaj
54327b0c23 Docker improvements (#274) 2024-05-07 22:11:14 -05:00
4 changed files with 60 additions and 8 deletions

View File

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

38
.github/workflows/push-docker-image.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Push Docker Image
on:
release:
types: [published]
jobs:
push-docker-image:
name: Push Docker Image
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
platforms:
- linux/amd64
- linux/arm64
steps:
- uses: actions/checkout@v4
- name: Retrieve major version
uses: winterjung/split@v2
id: split
with:
msg: ${{ github.ref_name }}
separator: .
- name: Log in to registry
uses: docker/login-action@v3
with:
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
- name: Build and push the Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: ${{ matrix.platforms }}
push: true
tags: ${{ secrets.DOCKERHUB_REPOSITORY }}:${{ github.ref_name }},${{ secrets.DOCKERHUB_REPOSITORY }}:${{ steps.split.outputs._0 }},${{ secrets.DOCKERHUB_REPOSITORY }}:latest

View File

@@ -1,4 +1,5 @@
FROM debian:latest
# build
FROM debian:stable-slim 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:stable-slim
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/database.db
- ./tdata:/usr/src/app/tdata
ports:
- "23000:23000"
- "23001:23001"