This commit is contained in:
syui 2024-02-22 20:03:29 +09:00
parent 5a7344b85d
commit 5488a7bd26
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56
5 changed files with 140 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.pg_data
mitra
mitra-web
dist

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM syui/aios
RUN git clone https://codeberg.org/silverpill/mitra /app/tmp
WORKDIR /app/tmp
RUN cargo build --release --features production
RUN mv target/release/mitra /app/
RUN mv target/release/mitractl /app/
WORKDIR /app
RUN rm -rf /app/tmp
ADD ./config.yaml /app/
ADD ./dist /app/dist
ENTRYPOINT ["/app/mitra"]

30
config.yaml Normal file
View File

@ -0,0 +1,30 @@
# Mitra configuration file
database_url: postgres://mitra:mitra@database/mitra
storage_dir: /app/data
web_client_dir: /app/dist
http_host: '0.0.0.0'
http_port: 8383
instance_uri: https://mitra.syu.is
instance_title: mitra.syu.is
instance_short_description: mitra.syu.is
# Long description can contain markdown syntax
instance_description: |
# My instance
Welcome!
# Make list of instance admins public
instance_staff_public: true
instance_timeline_public: true
registration:
type: invite
default_role: user
retention:
extraneous_posts: 50
empty_profiles: 150
federation:
enabled: true

58
docker-compose.yaml Normal file
View File

@ -0,0 +1,58 @@
version: "3"
services:
mitra:
ports:
- 8383:8383
build:
context: .
environment:
CONFIG_PATH: /app/config.yaml
volumes:
- ./data:/app/data
depends_on:
database:
condition: service_healthy
database:
#ports:
#- 55432:5432
image: postgres:13-bullseye
restart: always
environment:
POSTGRES_PASSWORD: mitra
POSTGRES_USER: mitra
POSTGRES_DB: mitra
volumes:
- ./postgres_database:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
# https://github.com/farcaster-project/containers
monerod:
profiles:
- monero
image: ghcr.io/farcaster-project/containers/monerod:0.18.2.2
environment:
NETWORK: regtest
OFFLINE: --offline
DIFFICULTY: 1
ports:
- "58081:18081"
monero-wallet-rpc:
profiles:
- monero
image: ghcr.io/farcaster-project/containers/monero-wallet-rpc:0.18.2.2
environment:
MONERO_DAEMON_ADDRESS: monerod:18081
WALLET_RPC_PORT: 18083
depends_on:
- "monerod"
ports:
- "58083:18083"
volumes:
- ./monero_wallets:/wallets

33
fly.toml Normal file
View File

@ -0,0 +1,33 @@
app = "xxx"
kill_signal = "SIGINT"
kill_timeout = 10
[env]
PORT = "8380"
[experimental]
cmd = "./mitra"
[[services]]
internal_port = 8380
protocol = "tcp"
[[services.ports]]
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
# [[services.ports]]
# handlers = ["tls", "http"]
# port = 5001
#
# [[services.ports]]
# handlers = ["tls", "http"]
# port = 8001
[mounts]
source="mitra_data"
destination="/app/files"