Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/one click railway deployment #385

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build-containers-enterprise.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "Build Containers Enterprise"
name: 'Build Containers Enterprise'

on:
workflow_dispatch:
Expand All @@ -20,7 +20,7 @@ jobs:

build-containers:
needs: build-containers-common
strategy:
strategy:
matrix:
include:
- runnertags: ubuntu-latest
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
docker images

- name: docker tag
env:
env:
CONTAINERVER: ${{ needs.build-containers-common.outputs.containerver }}
run: |
docker tag localhost/postiz ghcr.io/gitroomhq/postiz-app-enterprise:${{ matrix.arch }}-${{ env.CONTAINERVER }}
Expand All @@ -75,8 +75,8 @@ jobs:
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Create Docker Manifest
env:
- name: Create Docker Manifest
env:
CONTAINERVER: ${{ needs.build-containers-common.outputs.containerver }}
run: |
docker manifest create \
Expand Down
82 changes: 82 additions & 0 deletions .railway/template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
services:
web:
dockerfile: Dockerfile.dev
target: dist
numReplicas: 1
ports:
- 3000:3000
- 4200:4200
- 5000:5000
env:
- key: NODE_ENV
value: development
- key: PORT
value: 3000
- key: FRONTEND_PORT
value: 4200
- key: DATABASE_URL
fromService:
name: postgres
type: postgres
property: connectionString
- key: REDIS_URL
fromService:
name: redis
type: redis
property: connectionString
- key: JWT_SECRET
generate: secret
- key: SKIP_CONFIG_CHECK
value: "true"
- key: FRONTEND_URL
sync: RAILWAY_PUBLIC_DOMAIN
prefix: https://
- key: MAIN_URL
sync: RAILWAY_PUBLIC_DOMAIN
prefix: https://
- key: STORAGE_PROVIDER
value: local
- key: UPLOAD_DIRECTORY
value: /uploads
- key: NEXT_PUBLIC_API_URL
value: /api
volumes:
- name: uploads
mountPath: /uploads
persistent: true
- name: config
mountPath: /config
persistent: true

postgres:
image: postgres:17-alpine
env:
- key: POSTGRES_USER
value: postiz
- key: POSTGRES_PASSWORD
generate: password
- key: POSTGRES_DB
value: postiz
volumes:
- name: postgres-data
mountPath: /var/lib/postgresql/data
persistent: true

redis:
image: redis:7-alpine

volumes:
postgres-data:
name: postgres-data
persistent: true
uploads:
name: uploads
persistent: true
config:
name: config
persistent: true

scripts:
postdeploy: |
npx prisma generate
npx prisma db push --accept-data-loss
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<a href="https://opensource.org/licenses/Apache-2.0">
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License">
</a>
<a href="https://railway.app/new/template/gitroomhq/postiz-app">
<img src="https://railway.app/button.svg" alt="Deploy on Railway">
</a>
</p>

<div align="center">
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dev:workers": "npx nx run workers:serve:development",
"dev:cron": "npx nx run cron:serve:development",
"dev:docker": "docker compose -f ./docker-compose.dev.yaml up -d",
"start": "npm run dev",
"start:prod": "node dist/apps/backend/main.js",
"start:prod:frontend": "nx run frontend:serve:production",
"start:prod:workers": "node dist/apps/workers/main.js",
Expand Down
2 changes: 1 addition & 1 deletion var/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ if [[ $POSTIZ_APPS == *"backend"* ]]; then
ln -sf /app/supervisord_available_configs/backend.conf /etc/supervisor.d/
fi

/usr/bin/supervisord -c /etc/supervisord.conf
/usr/bin/supervisord -c /etc/supervisord.conf