Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Clivern committed Jun 17, 2024
1 parent 951d220 commit 195ae31
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish Docker Image

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@f7b4ed12385588c3f9bc252f0a2b520d83b52d48
with:
images: clivern/badger

- name: Build and push Docker image
uses: docker/build-push-action@86c2bd00318427a320d2cee5bbc61251df6f647e
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.20.4

ARG BADGER_VERSION=0.3.0

RUN mkdir -p /app/configs
RUN mkdir -p /app/var/logs
RUN apt-get update

WORKDIR /app

RUN curl -sL https://github.com/Uptimedog/Badger/releases/download/v${BADGER_VERSION}/badger_Linux_x86_64.tar.gz | tar xz
RUN rm LICENSE
RUN rm README.md

COPY ./config.dist.yml /app/configs/

EXPOSE 8080

VOLUME /app/configs
VOLUME /app/var

RUN ./badger version

CMD ["./badger", "server", "-c", "/app/configs/config.dist.yml"]
2 changes: 1 addition & 1 deletion config.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ server:
# Server name
name: ${BADGER_SERVER_NAME:-badger}
# Env mode (dev or prod)
mode: ${BADGER_SERVER_MODE:-dev}
mode: ${BADGER_SERVER_MODE:-prod}
# HTTP port
port: ${BADGER_SERVER_PORT:-8000}
# Hostname
Expand Down
2 changes: 1 addition & 1 deletion config.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ server:
# Server name
name: ${BADGER_SERVER_NAME:-badger}
# Env mode (dev or prod)
mode: ${BADGER_SERVER_MODE:-dev}
mode: ${BADGER_SERVER_MODE:-prod}
# HTTP port
port: ${BADGER_SERVER_PORT:-8000}
# Hostname
Expand Down

0 comments on commit 195ae31

Please sign in to comment.