mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-06-01 19:32:38 +00:00
Merge branch 'docker-compose' into 'develop'
Draft: A full-featured docker compose example See merge request pleroma/pleroma!4005
This commit is contained in:
commit
66fcb0d8d1
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -59,3 +59,5 @@ pleroma.iml
|
|||
# Editor temp files
|
||||
/*~
|
||||
/*#
|
||||
|
||||
workdir
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ARG ELIXIR_IMG=hexpm/elixir
|
||||
ARG ELIXIR_VER=1.12.3
|
||||
ARG ERLANG_VER=24.2.1
|
||||
ARG ALPINE_VER=3.17.0
|
||||
ARG ELIXIR_VER=1.14.5
|
||||
ARG ERLANG_VER=25.1.2.1
|
||||
ARG ALPINE_VER=3.18.4
|
||||
|
||||
FROM ${ELIXIR_IMG}:${ELIXIR_VER}-erlang-${ERLANG_VER}-alpine-${ALPINE_VER} as build
|
||||
|
||||
|
@ -14,6 +14,8 @@ RUN apk add git gcc g++ musl-dev make cmake file-dev vips-dev &&\
|
|||
echo "import Config" > config/prod.secret.exs &&\
|
||||
mix local.hex --force &&\
|
||||
mix local.rebar --force &&\
|
||||
mix deps.clean --all &&\
|
||||
mix clean &&\
|
||||
mix deps.get --only prod &&\
|
||||
mkdir release &&\
|
||||
mix release --path release
|
||||
|
|
|
@ -7,6 +7,10 @@ while ! pg_isready -U ${DB_USER:-pleroma} -d postgres://${DB_HOST:-db}:${DB_PORT
|
|||
sleep 1s
|
||||
done
|
||||
|
||||
echo "-- Creating db..."
|
||||
$HOME/bin/pleroma_ctl create
|
||||
|
||||
|
||||
echo "-- Running migrations..."
|
||||
$HOME/bin/pleroma_ctl migrate
|
||||
|
||||
|
|
36
installation/docker-compose/docker-compose.yml
Normal file
36
installation/docker-compose/docker-compose.yml
Normal file
|
@ -0,0 +1,36 @@
|
|||
version: '3.4'
|
||||
|
||||
services:
|
||||
web:
|
||||
build: ../..
|
||||
ports:
|
||||
- "4000:4000"
|
||||
environment:
|
||||
DB_USER: postgres
|
||||
DB_PASS: postgres
|
||||
GRAFANA_HOST: http://grafana:3000
|
||||
volumes:
|
||||
- "./workdir/pleroma:/var/lib/pleroma"
|
||||
restart: "always"
|
||||
db:
|
||||
image: postgres:16
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
PGDATA: "/pg_data"
|
||||
restart: "always"
|
||||
volumes:
|
||||
- "./workdir/pg_data:/pg_data"
|
||||
grafana:
|
||||
image: grafana/grafana-enterprise
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- "./workdir/grafana:/var/lib/grafana"
|
||||
- "./grafana-provisioning/:/etc/grafana/provisioning/"
|
||||
prometheus:
|
||||
image: prom/prometheus
|
||||
ports:
|
||||
- "9090:9090"
|
||||
volumes:
|
||||
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
|
|
@ -0,0 +1,7 @@
|
|||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
|
||||
- name: pleroma
|
||||
type: prometheus
|
||||
url: http://prometheus:9090
|
5
installation/docker-compose/prometheus.yml
Normal file
5
installation/docker-compose/prometheus.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
scrape_configs:
|
||||
- job_name: "pleroma"
|
||||
scrape_interval: 5s
|
||||
static_configs:
|
||||
- targets: ['web:4021']
|
Loading…
Reference in a new issue