Skip to content

Commit

Permalink
chore: Update Dockerfile and docker-compose, add gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
juddisjudd committed May 3, 2024
1 parent 1d614a7 commit 3398c66
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Push Docker image

on:
push:
branches:
- master

jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ipajudd/oxbot:latest
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ WORKDIR /app
RUN npm install -g pnpm

COPY package.json pnpm-lock.yaml ./

RUN pnpm install --frozen-lockfile

COPY . .
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.production.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
version: '3.9'

services:
bot:
container_name: oxbot
build: .
restart: unless-stopped
command: pnpm start:production
volumes:
- db-data:/app/prisma
environment:
- DATABASE_URL=file:/app/prisma/data.db

watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 600 oxbot # Polls every 10 minutes and updates only the 'oxbot' container

volumes:
db-data:

0 comments on commit 3398c66

Please sign in to comment.