Skip to content

Commit

Permalink
feat: build scripts into docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanhonof committed Dec 18, 2023
1 parent 1835870 commit f87a67b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:

jobs:
buildx:
strategy:
matrix:
context: [app, scripts]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -18,9 +21,9 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
- name: Build and push app
uses: docker/build-push-action@v5
with:
context: ./app
context: ./${{ matrix.context }}
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/iot-api-server:latest
tags: ${{ secrets.DOCKERHUB_USERNAME }}/iot-api-server-${{ matrix.context }}:latest
2 changes: 1 addition & 1 deletion app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ RUN apt update -y
RUN apt upgrade -y
COPY --from=builder /dist/bin/server /usr/local/bin/server
EXPOSE 8080
WORKDIR /var/lib/iot-server
WORKDIR /var/lib/iot-api-server
ENTRYPOINT ["/usr/local/bin/server"]
14 changes: 10 additions & 4 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
services:
api-server:
build: .
image: bryanhonof/iot-api-server
ports:
- "8080:8080"
volumes:
- iot-db:/var/lib/iot-server
- db:/var/lib/iot-api-server
networks:
- backend
grafana:
image: grafana/grafana-enterprise
container_name: grafana
Expand All @@ -13,7 +15,11 @@ services:
- '3000:3000'
volumes:
- grafana-storage:/var/lib/grafana
- iot-db:/var/lib/iot-server
- db:/var/lib/iot-api-server
networks:
- backend
volumes:
grafana-storage: {}
iot-db: {}
db: {}
networks:
backend:
6 changes: 6 additions & 0 deletions scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM debian:bookworm

RUN apt update -y
RUN apt upgrade -y
RUN apt install -y sqlite3
COPY . /usr/local/bin

0 comments on commit f87a67b

Please sign in to comment.