Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Mar 24, 2024
1 parent 3cfc588 commit 4abec7b
Show file tree
Hide file tree
Showing 3 changed files with 2,345 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Docker

on:
push:
branches:
- main
tags:
- '*'
paths-ignore:
- 'docs/**'

jobs:
docker:
runs-on: ubuntu-latest
env:
USER: sdss
APP: lvmredis
steps:
- name: Set docker tags
id: set-tags
run: |
if [[ $GITHUB_REF == refs/heads/main ]]
then
echo TAGS=$USER/$APP:latest >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/* ]]
then
BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's/[\/]/_/g')
echo TAGS=$USER/$APP:$BRANCH >> $GITHUB_OUTPUT
else
echo TAGS=$USER/$APP:${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT
fi
- name: Show tags
run: echo ${{ steps.set-tags.outputs.TAGS }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/${{ steps.set-tags.outputs.TAGS }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM redis:7.2-bookworm
COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
Loading

0 comments on commit 4abec7b

Please sign in to comment.