

10 changed files with 270 additions and 459 deletions
@ -1,122 +0,0 @@
@@ -1,122 +0,0 @@
|
||||
changequote(`<', `>') |
||||
|
||||
define(<upcase>, <translit($1, <a-z>, <A-Z>)>) |
||||
define(<env>, <upcase($1)=${upcase($1):?upcase($1)}>) |
||||
define(<env_fb>, <upcase($1)=${upcase($1):-$2}>) |
||||
define(<env_inline>, <${upcase($1):?upcase($1)}>) |
||||
define(<env_inline_fb>, <${upcase($1):-$2}>) |
||||
|
||||
{ |
||||
"version": "3.7", |
||||
|
||||
ifdef(<__DOCKER_NETWORK>, < |
||||
"networks": { |
||||
"default": { |
||||
"external": { |
||||
"name": "__DOCKER_NETWORK" |
||||
} |
||||
} |
||||
}, |
||||
>) |
||||
|
||||
"services": { |
||||
ifelse(__SCRIPT_DEPLOY_POSTGRES, true, < |
||||
"db": { |
||||
"image": "postgres:10.3-alpine", |
||||
"restart": "unless-stopped", |
||||
"environment": [ |
||||
"env(<postgres_db>)", |
||||
"env(<postgres_user>)", |
||||
"env(<postgres_password>)" |
||||
], |
||||
"volumes": [ |
||||
"env_inline(<docker_datadir>)/db:/var/lib/postgresql/data", |
||||
"./initdb.sql:/docker-entrypoint-initdb.d/pleroma.sql" |
||||
] |
||||
}, |
||||
>) |
||||
|
||||
ifdef(<__SCRIPT_USE_PROXY>, < |
||||
ifelse( |
||||
__SCRIPT_USE_PROXY, traefik, <>, |
||||
__SCRIPT_USE_PROXY, manual, <>, |
||||
__SCRIPT_USE_PROXY, nginx, < |
||||
"proxy": { |
||||
"image": "nginx:alpine", |
||||
"ports": [ |
||||
"__SCRIPT_BIND_IP:__SCRIPT_PORT_HTTP:__SCRIPT_PORT_HTTP"ifdef(__SCRIPT_ENABLE_SSL, <,>) |
||||
ifdef(__SCRIPT_ENABLE_SSL, <"__SCRIPT_BIND_IP:__SCRIPT_PORT_HTTPS:__SCRIPT_PORT_HTTPS">) |
||||
], |
||||
"links": [ |
||||
"server:pleroma" |
||||
], |
||||
"volumes": [ |
||||
"./custom.d/server.nginx:/etc/nginx/nginx.conf:ro", |
||||
"./custom.d/vhost.nginx:/etc/nginx/conf.d/pleroma.conf:ro"ifdef(__SCRIPT_ENABLE_SSL, <,>) |
||||
ifdef(__SCRIPT_ENABLE_SSL, <"./custom.d/ssl.crt:/ssl/ssl.crt:ro",>) |
||||
ifdef(__SCRIPT_ENABLE_SSL, <"./custom.d/ssl.key:/ssl/ssl.key:ro">) |
||||
] |
||||
}, |
||||
>, __SCRIPT_USE_PROXY, apache, < |
||||
"proxy": { |
||||
"image": "amd64/apache:alpine", |
||||
"ports": [ |
||||
"__SCRIPT_BIND_IP:__SCRIPT_PORT_HTTP:__SCRIPT_PORT_HTTP"ifdef(__SCRIPT_ENABLE_SSL, <,>) |
||||
ifdef(__SCRIPT_ENABLE_SSL, <"__SCRIPT_BIND_IP:__SCRIPT_PORT_HTTPS:__SCRIPT_PORT_HTTPS">) |
||||
], |
||||
"links": [ |
||||
"server:pleroma" |
||||
], |
||||
"volumes": [ |
||||
"./custom.d/server.httpd:/usr/local/apache2/conf/httpd.conf:ro", |
||||
"./custom.d/vhost.httpd:/usr/local/apache2/conf/extra/httpd-vhosts.conf:ro"ifdef(__SCRIPT_ENABLE_SSL, <,>) |
||||
ifdef(__SCRIPT_ENABLE_SSL, <"./custom.d/ssl.crt:/ssl/ssl.crt:ro",>) |
||||
ifdef(__SCRIPT_ENABLE_SSL, <"./custom.d/ssl.key:/ssl/ssl.key:ro">) |
||||
] |
||||
}, |
||||
>, < |
||||
errprint(Invalid option __SCRIPT_USE_PROXY for <SCRIPT_USE_PROXY>) |
||||
m4exit(<1>) |
||||
> |
||||
) |
||||
>) |
||||
|
||||
"server": { |
||||
"build": { |
||||
"context": ".", |
||||
"args": [ |
||||
"env(<pleroma_version>)", |
||||
"env(<docker_uid>)", |
||||
"env(<docker_gid>)", |
||||
"env_fb(<pleroma_uploads_path>, </uploads>)" |
||||
] |
||||
}, |
||||
"init": true, |
||||
"restart": "unless-stopped", |
||||
"links": [ |
||||
ifelse(__SCRIPT_DEPLOY_POSTGRES, true, <"db">) |
||||
], |
||||
"environment": [ |
||||
"env_fb(<mix_env>, <prod>)" |
||||
], |
||||
"volumes": [ |
||||
"./custom.d:/custom.d:ro", |
||||
"./config.exs:/home/pleroma/pleroma/config/prod.secret.exs:ro", |
||||
"env_inline(<docker_datadir>)/uploads:env_inline_fb(<pleroma_uploads_path>, </uploads>)" |
||||
], |
||||
"labels": [ |
||||
ifelse(__SCRIPT_USE_PROXY, traefik, < |
||||
"traefik.enable=true", |
||||
"traefik.fe.port=4000", |
||||
"traefik.fe.protocol=http", |
||||
"traefik.fe.entryPoints=http,https", |
||||
"traefik.fe.frontend.rule=Host:patsubst(__PLEROMA_URL, <string:>, <>)", |
||||
"traefik.cache.port=4000", |
||||
"traefik.cache.protocol=http", |
||||
"traefik.cache.entryPoints=http,https", |
||||
"traefik.cache.frontend.rule=Host:patsubst(patsubst(__PLEROMA_MEDIA_PROXY_URL, <http.*?//>, <>), <string:>, <>)" |
||||
>) |
||||
] |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
version: "3.7" |
||||
|
||||
services: |
||||
db: |
||||
image: postgres:10-alpine |
||||
init: true |
||||
restart: unless-stopped |
||||
environment: { |
||||
# This might seem insecure but is usually not a problem. |
||||
# You should leave this at the "pleroma" default. |
||||
# The DB is only reachable by containers in the same docker network, |
||||
# and is not exposed to the open internet. |
||||
# |
||||
# If you do change this, remember to update "config.exs". |
||||
POSTGRES_DB: pleroma, |
||||
POSTGRES_USER: pleroma, |
||||
POSTGRES_PASSWORD: pleroma, |
||||
} |
||||
volumes: |
||||
- $DOCKER_DATADIR/db:/var/lib/postgresql/data |
||||
- ./initdb.sql:/docker-entrypoint-initdb.d/pleroma.sql |
||||
|
||||
server: |
||||
build: . |
||||
init: true |
||||
restart: unless-stopped |
||||
links: |
||||
- db |
||||
ports: [ |
||||
# Uncomment/Change port mappings below as needed. |
||||
# The left side is your host machine, the right one is the pleroma container. |
||||
# You can prefix the left side with an ip. |
||||
|
||||
# Webserver (for reverse-proxies outside of docker) |
||||
# If you use a dockerized proxy (see README), you can leave this commented |
||||
# and use a container link instead. |
||||
# "127.0.0.1:4000:4000", |
||||
|
||||
# SSH support |
||||
# "2222:2222", |
||||
|
||||
# Gopher support |
||||
# "9999:9999", |
||||
] |
||||
volumes: |
||||
- ./custom.d:/custom.d:ro |
||||
- ./config.exs:/home/pleroma/pleroma/config/prod.secret.exs:ro |
||||
- ./config.exs:/home/pleroma/pleroma/config/dev.secret.exs:ro |
||||
- $DOCKER_DATADIR/uploads:/uploads |
Loading…
Reference in new issue