Skip to content

Commit

Permalink
feat: add build action and compose
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoCasa committed Apr 5, 2024
1 parent b510d51 commit 345b3fc
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DB_PASSWORD=changeme
APP_URL=https://app.example.com
LICENSE_KEY=my.123.key
38 changes: 38 additions & 0 deletions .github/workflows/build-worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and push docker image
on:
workflow_dispatch:

jobs:
build:
runs-on: ubicloud-standard-8
steps:
- uses: actions/checkout@v4
with:
repository: windmill-labs/windmillhub
token: ${{ secrets.WINDMILLHUB_GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker metadata
id: metadata
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository }}
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push privately
uses: docker/build-push-action@v3
with:
context: .
push: true
provenance: false
tags: ${{ steps.metadata.outputs.tags }}
labels: |
${{ steps.metadata.outputs.labels }}
org.opencontainers.image.licenses=Windmill-Enterprise-License
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
5 changes: 5 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{$BASE_URL} {
bind {$ADDRESS}
reverse_proxy /* http://hub:3000
# tls /certs/cert.pem /certs/key.pem
}
50 changes: 50 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: '3.7'

services:
db:
image: postgres:16
restart: always
volumes:
- db_data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: windmillhub
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 10s
timeout: 5s
retries: 5
hub:
image: ghcr.io/windmill-labs/windmillhub-ee:main
privileged: true
restart: unless-stopped
expose:
- 3000
environment:
- DATABASE_URL=postgres://postgres:${DB_PASSWORD}@db/windmillhub?sslmode=disable
- PUBLIC_PRIVATE_HUB=true
- PUBLIC_APP_URL=${APP_URL}
- LICENSE_KEY=${LICENSE_KEY}

depends_on:
db:
condition: service_healthy
caddy:
image: caddy:2.5.2-alpine
restart: unless-stopped

# Configure the mounted Caddyfile and the exposed ports or use another reverse proxy if needed
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
# - ./certs:/certs # Provide custom certificate files like cert.pem and key.pem to enable HTTPS - See the corresponding section in the Caddyfile
ports:
# To change the exposed port, simply change 80:80 to <desired_port>:80. No other changes needed
- 80:80
# - 443:443 # Uncomment to enable HTTPS handling by Caddy
environment:
- BASE_URL=":80"
# - BASE_URL=":443" # uncomment and comment line above to enable HTTPS via custom certificate and key files
# - BASE_URL=hub.example.com # Uncomment and comment line above to enable HTTPS handling by Caddy

volumes:
db_data: null

0 comments on commit 345b3fc

Please sign in to comment.