fix docker config

This commit is contained in:
André Menrath 2024-06-30 14:48:51 +02:00
parent 0d80f1e8e6
commit 30c93d9c88
3 changed files with 57 additions and 163 deletions

View file

@ -35,51 +35,53 @@ services:
mobilizon:
container_name: mobilizon
image: docker.io/framasoft/mobilizon
restart: unless-stopped
build:
context: ./mobilizon/mobilizon
dockerfile: Dockerfile
volumes:
- "./mobilizon/mobilizon:/app"
# - "./mobilizon/dev.exs:/app/config/dev.exs"
- /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:rox
depends_on:
- postgres
environment:
MIX_ENV: "dev"
DOCKER: "true"
MOBILIZON_INSTANCE_NAME: Mobilizon Local
MOBILIZON_INSTANCE_HOST: mz.lan
MOBILIZON_INSTANCE_LISTEN_IP: "0.0.0.0"
MOBILIZON_INSTANCE_PORT: "4000"
MOBILIZON_INSTANCE_EMAIL: linos@example.com
MOBILIZON_REPLY_EMAIL: linos@example.com
MOBILIZON_INSTANCE_REGISTRATIONS_OPEN: true
MOBILIZON_DATABASE_USERNAME: mobilizon
MOBILIZON_INSTANCE_HOST_PORT: 443
MOBILIZON_INSTANCE_SCHEME: https
MOBILIZON_INSTANCE_EMAIL: noreply@mobilizon.me
MOBILIZON_INSTANCE_REGISTRATIONS_OPEN: "true"
MOBILIZON_DATABASE_PASSWORD: mobilizon
MOBILIZON_DATABASE_USERNAME: mobilizon
MOBILIZON_DATABASE_DBNAME: mobilizon
MOBILIZON_DATABASE_HOST: mobilizon_db
MOBILIZON_DATABASE_PORT: "5432"
MOBILIZON_DATABASE_SSL: false
MOBILIZON_INSTANCE_SECRET_KEY_BASE: Twxx5T5En+PeV6q79o+K9EPtAQ6wCVldqPP3m3JQo3idqqddNH8w9bxZQTNQ1ssgKsk=
MOBILIZON_INSTANCE_SECRET_KEY: pcv2o2Fq591I0V91NVwJHpWL2IAsd7+bwcyMmUhuAoXpjhlbdB0hI251O8M27Bs9+SM=
MOBILIZON_LOGLEVEL: info # debug
MOBILIZON_CA_CERT_PATH: "/usr/share/ca-certificates/mozilla/ca-certificates.crt"
volumes:
- ./mobilizon/uploads:/var/lib/mobilizon/uploads
#- ./mobilizon/config.exs:/etc/mobilizon/config.exs:ro
- /etc/ssl/certs/ca-certificates.crt:/usr/share/ca-certificates/mozilla/ca-certificates.crt:rox
- /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:rox
- /etc/ssl/certs/mkcert_linos_yoga__Andr___Menrath_.pem:/usr/share/ca-certificates/mozilla/mkcert_linos_yoga__Andr___Menrath_.pem:roxs
- /etc/ssl/certs/mkcert_linos_yoga__Andr___Menrath_.pem:/etc/ssl/certs/mkcert_linos_yoga__Andr___Menrath_.pem:rox
MOBILIZON_DATABASE_HOST: postgres
MOBILIZON_DATABASE_PORT: 5432
VITE_HOST: 0.0.0.0
MOBILIZON_CA_CERT_PATH: "/etc/ssl/certs/ca-certificates.crt"
command: sh -c "mix phx.server"
expose:
- "443"
- "4000"
ports:
- "4000:4000"
- "5173:5173"
# gancio:
# restart: always
# image: cisti/gancio
# container_name: gancio
# environment:
# - PATH=$PATH:/home/node/.yarn/bin
# - GANCIO_DATA=/home/node/data
# - NODE_ENV=development
# - GANCIO_DB_DIALECT=sqlite
# - GANCIO_DB_STORAGE=./gancio.sqlite
# volumes:
# - ./gancio/data:/home/node/data
# ports:
# - "13120:13120"
gancio:
restart: always
image: cisti/gancio
container_name: gancio
environment:
- PATH=$PATH:/home/node/.yarn/bin
- GANCIO_DATA=/home/node/data
- NODE_ENV=development
- GANCIO_DB_DIALECT=sqlite
- GANCIO_DB_STORAGE=./gancio.sqlite
volumes:
- ./gancio/data:/home/node/data
ports:
- "13120:13120"
wordpress:
build:

View file

@ -1,108 +0,0 @@
import Config
config :mobilizon, Mobilizon.Web.Endpoint,
https: [
port: String.to_integer(System.get_env("MOBILIZON_INSTANCE_HOST_PORT", "4000")),
keyfile: "priv/certs/lan-key.pem",
certfile: "priv/certs/lan.pem"
],
url: [
host: System.get_env("MOBILIZON_INSTANCE_HOST", "mobilizon.local"),
port: String.to_integer(System.get_env("MOBILIZON_INSTANCE_HOST_PORT", "443")),
scheme: "https"
],
secret_key_base: System.get_env("MOBILIZON_INSTANCE_SECRET_KEY_BASE", "changethis"),
debug_errors: true,
code_reloader: true,
check_origin: false,
watchers: [
node: [
"node_modules/.bin/vite",
"--host",
System.get_env("VITE_HOST", "localhost")
]
]
# ## SSL Support
#
# In order to use HTTPS in development, a self-signed
# certificate can be generated by running the following
# command from your terminal:
#
# openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout priv/server.key -out priv/server.pem
#
# The `http:` config above can be replaced with:
#
# https: [port: 4000, keyfile: "priv/server.key", certfile: "priv/server.pem"],
#
# If desired, both `http:` and `https:` keys can be
# configured to run both http and https servers on
# different ports.
# Watch static and templates for browser reloading.
config :mobilizon, Mobilizon.Web.Endpoint,
live_reload: [
patterns: [
~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$},
~r{priv/gettext/.*(po)$},
~r{lib/web/(live|views)/.*(ex)$},
~r{lib/web/templates/.*(eex)$}
]
]
# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "$metadata[$level] $message\n", level: :debug
config :mobilizon, Mobilizon.Service.Geospatial, service: Mobilizon.Service.Geospatial.Nominatim
config :mobilizon, Mobilizon.Web.Gettext, allowed_locales: ["fr", "en", "ru", "ar"]
# Set a higher stacktrace during development. Avoid configuring such
# in production as building large stacktraces may be expensive.
config :phoenix, :stacktrace_depth, 20
# Initialize plugs at runtime for faster development compilation
config :phoenix, :plug_init_mode, :runtime
config :mobilizon, Mobilizon.Web.Email.Mailer, adapter: Swoosh.Adapters.Local
# Configure your database
config :mobilizon, Mobilizon.Storage.Repo,
username: System.get_env("MOBILIZON_DATABASE_USERNAME", "mobilizon"),
password: System.get_env("MOBILIZON_DATABASE_PASSWORD", "mobilizon"),
database: System.get_env("MOBILIZON_DATABASE_DBNAME", "mobilizon_dev"),
hostname: System.get_env("MOBILIZON_DATABASE_HOST", "localhost"),
port: System.get_env("MOBILIZON_DATABASE_PORT", "5432"),
pool_size: 10,
show_sensitive_data_on_connection_error: true,
# Logging is handled by Ecto.DevLogger
log: false
config :mobilizon, :instance,
name: System.get_env("MOBILIZON_INSTANCE_NAME", "Mobilizon"),
hostname: System.get_env("MOBILIZON_INSTANCE_HOST", "Mobilizon"),
email_from: System.get_env("MOBILIZON_INSTANCE_EMAIL"),
email_reply_to: System.get_env("MOBILIZON_INSTANCE_EMAIL"),
registrations_open: System.get_env("MOBILIZON_INSTANCE_REGISTRATIONS_OPEN") == "true",
groups: true
config :mobilizon, Mobilizon.Web.Auth.Guardian,
secret_key: System.get_env("MOBILIZON_INSTANCE_SECRET_KEY", "changethis")
# config :mobilizon, :activitypub, sign_object_fetches: false
config :mobilizon, Mobilizon.Web.Upload.Uploader.Local, uploads: "uploads"
config :mobilizon, :exports, path: "uploads/exports"
config :mobilizon, Mobilizon.Service.SiteMap,
path: System.get_env("MOBILIZON_SITEMAP_PATH", "priv/static")
config :tz_world, data_dir: "_build/dev/lib/tz_world/priv"
config :mobilizon, :anonymous,
reports: [
allowed: true
]
config :unplug, :init_mode, :runtime

View file

@ -63,7 +63,7 @@ http {
proxy_set_header X-Forwarded-Proto $scheme;
location / {
proxy_pass "http://mobilizon:4000";
proxy_pass "http://mobilizon:443";
}
}
@ -74,26 +74,26 @@ http {
return 301 https://$server_name$request_uri;
}
# server {
# server_name ga.lan;
# listen 443 ssl;
# http2 on;
server {
server_name ga.lan;
listen 443 ssl;
http2 on;
# ssl_certificate /etc/nginx/certs/lan.pem;
# ssl_certificate_key /etc/nginx/certs/lan-key.pem;
ssl_certificate /etc/nginx/certs/lan.pem;
ssl_certificate_key /etc/nginx/certs/lan-key.pem;
# client_max_body_size 16m;
client_max_body_size 16m;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# proxy_set_header Host $http_host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# location / {
# proxy_pass "http://gancio:13120";
# }
# }
location / {
proxy_pass "http://gancio:13120";
}
}
}