From 78e58b3888dc0d623ce6b132e49aacc6ab14bf2f Mon Sep 17 00:00:00 2001 From: adriy Date: Wed, 2 Oct 2024 13:31:59 +0200 Subject: [PATCH] fc --- .env.sample | 26 +++++++++++++++++++++++ docker-compose.yml | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .env.sample create mode 100644 docker-compose.yml diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..6cdea8b --- /dev/null +++ b/.env.sample @@ -0,0 +1,26 @@ +# ============================================================================= +# PRODUCTION CONFIG EXAMPLE +# ----------------------------------------------------------------------------- +# By default it will use SQLite, but that's mostly to test and evaluate the +# server. So you'll want to specify db connection settings to use Postgres. +# ============================================================================= +# +APP_BASE_URL= +APP_PORT= +# +DB_CLIENT= +POSTGRES_PASSWORD= +POSTGRES_DATABASE= +POSTGRES_USER= +POSTGRES_PORT= +POSTGRES_HOST= + +# ============================================================================= +# DEV CONFIG EXAMPLE +# ----------------------------------------------------------------------------- +# Example of local config, for development. In dev mode, you would usually use +# SQLite so database settings are not needed. +# ============================================================================= +# +# APP_BASE_URL=http://localhost:22300 +# APP_PORT=22300 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..49b3192 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,52 @@ +# This is a sample docker-compose file that can be used to run Joplin Server +# along with a PostgreSQL server. +# +# Update the following fields in the stanza below: +# +# POSTGRES_USER +# POSTGRES_PASSWORD +# APP_BASE_URL +# +# APP_BASE_URL: This is the base public URL where the service will be running. +# - If Joplin Server needs to be accessible over the internet, configure APP_BASE_URL as follows: https://example.com/joplin. +# - If Joplin Server does not need to be accessible over the internet, set the the APP_BASE_URL to your server's hostname. +# For Example: http://[hostname]:22300. The base URL can include the port. +# APP_PORT: The local port on which the Docker container will listen. +# - This would typically be mapped to port to 443 (TLS) with a reverse proxy. +# - If Joplin Server does not need to be accessible over the internet, the port can be mapped to 22300. + +version: '3' + +services: + db-joplin: + image: postgres:13 + volumes: + - ./data/postgres:/var/lib/postgresql/data + #ports: + #- "5432:5432" + restart: unless-stopped + environment: + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_DB=${POSTGRES_DATABASE} + joplin: + image: joplin/server:latest + depends_on: + - db-joplin + # ports: + #- "22300:22300" + restart: unless-stopped + environment: + - APP_PORT=22300 + - APP_BASE_URL=${APP_BASE_URL} + - DB_CLIENT=pg + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_DATABASE=${POSTGRES_DATABASE} + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PORT=${POSTGRES_PORT} + - POSTGRES_HOST=db-joplin + +networks: + default: + external: + name: my-network