Setup: Update cloud config example
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
parent
a9357d8b2d
commit
3c33df81de
2 changed files with 26 additions and 16 deletions
|
@ -139,6 +139,7 @@ services:
|
||||||
PHOTOPRISM_LOG_LEVEL: "info" # log level: trace, debug, info, warning, error, fatal, or panic
|
PHOTOPRISM_LOG_LEVEL: "info" # log level: trace, debug, info, warning, error, fatal, or panic
|
||||||
PHOTOPRISM_READONLY: "false" # do not modify originals directory (reduced functionality)
|
PHOTOPRISM_READONLY: "false" # do not modify originals directory (reduced functionality)
|
||||||
PHOTOPRISM_EXPERIMENTAL: "false" # enables experimental features
|
PHOTOPRISM_EXPERIMENTAL: "false" # enables experimental features
|
||||||
|
PHOTOPRISM_DISABLE_TLS: "true" # disables HTTPS even if a certificate is available
|
||||||
PHOTOPRISM_DISABLE_CHOWN: "false" # disables updating storage permissions via chmod and chown on startup
|
PHOTOPRISM_DISABLE_CHOWN: "false" # disables updating storage permissions via chmod and chown on startup
|
||||||
PHOTOPRISM_DISABLE_WEBDAV: "false" # disables built-in WebDAV server
|
PHOTOPRISM_DISABLE_WEBDAV: "false" # disables built-in WebDAV server
|
||||||
PHOTOPRISM_DISABLE_SETTINGS: "false" # disables Settings in Web UI
|
PHOTOPRISM_DISABLE_SETTINGS: "false" # disables Settings in Web UI
|
||||||
|
@ -169,7 +170,7 @@ services:
|
||||||
## see https://docs.photoprism.app/getting-started/proxies/traefik/
|
## see https://docs.photoprism.app/getting-started/proxies/traefik/
|
||||||
traefik:
|
traefik:
|
||||||
restart: always
|
restart: always
|
||||||
image: traefik:v2.8
|
image: traefik:v2.9
|
||||||
container_name: traefik
|
container_name: traefik
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
|
|
|
@ -32,35 +32,40 @@ echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
||||||
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
||||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
||||||
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing
|
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing && \
|
||||||
|
echo 'force-confold' > /etc/dpkg/dpkg.cfg.d/force-confold
|
||||||
|
|
||||||
# update operating system
|
# update operating system
|
||||||
apt-get update
|
apt-get update
|
||||||
apt dist-upgrade 2>/dev/null
|
apt dist-upgrade 2>/dev/null
|
||||||
|
|
||||||
# install dependencies
|
# install dependencies
|
||||||
apt-get -qq install --no-install-recommends apt-transport-https ca-certificates \
|
apt-get -qq install --no-install-recommends apt-utils apt-transport-https ca-certificates \
|
||||||
curl software-properties-common openssl
|
curl software-properties-common openssl gnupg lsb-release
|
||||||
|
|
||||||
# install docker if needed
|
echo "Installing Docker..."
|
||||||
if ! command -v docker &> /dev/null; then
|
|
||||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/download.docker.com.gpg
|
|
||||||
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
|
|
||||||
apt-get update
|
|
||||||
apt-get -qq install docker-ce
|
|
||||||
fi
|
|
||||||
|
|
||||||
# install docker-compose if needed
|
# add docker repository key
|
||||||
if ! command -v docker-compose &> /dev/null; then
|
mkdir -p /etc/apt/keyrings
|
||||||
apt-get update
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
apt-get -qq install docker-compose
|
chmod a+r /etc/apt/keyrings/docker.gpg
|
||||||
fi
|
|
||||||
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
|
||||||
|
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
|
||||||
|
# install docker incl compose plugin
|
||||||
|
apt-get update
|
||||||
|
apt-get -qq install docker-ce docker-ce-cli docker-ce-rootless-extras containerd.io docker-compose-plugin cgroupfs-mount libltdl7 pigz
|
||||||
|
|
||||||
|
echo "Adding user..."
|
||||||
|
|
||||||
# create user
|
# create user
|
||||||
useradd -o -m -U -u 1000 -G docker -d /opt/photoprism photoprism || echo "User 'photoprism' already exists. Proceeding."
|
useradd -o -m -U -u 1000 -G docker -d /opt/photoprism photoprism || echo "User 'photoprism' already exists. Proceeding."
|
||||||
mkdir -p /opt/photoprism/originals /opt/photoprism/import /opt/photoprism/storage /opt/photoprism/backup \
|
mkdir -p /opt/photoprism/originals /opt/photoprism/import /opt/photoprism/storage /opt/photoprism/backup \
|
||||||
/opt/photoprism/database /opt/photoprism/traefik /opt/photoprism/certs
|
/opt/photoprism/database /opt/photoprism/traefik /opt/photoprism/certs
|
||||||
|
|
||||||
|
echo "Generating certificates..."
|
||||||
|
|
||||||
# download ssl config
|
# download ssl config
|
||||||
curl -fsSL https://dl.photoprism.app/docker/cloud/certs/ca.conf > /opt/photoprism/certs/ca.conf
|
curl -fsSL https://dl.photoprism.app/docker/cloud/certs/ca.conf > /opt/photoprism/certs/ca.conf
|
||||||
curl -fsSL https://dl.photoprism.app/docker/cloud/certs/cert.conf > /opt/photoprism/certs/cert.conf
|
curl -fsSL https://dl.photoprism.app/docker/cloud/certs/cert.conf > /opt/photoprism/certs/cert.conf
|
||||||
|
@ -92,6 +97,8 @@ chmod 600 /root/.initial-password.txt
|
||||||
# detect public server ip address
|
# detect public server ip address
|
||||||
PUBLIC_IP=$(curl -sfSL ifconfig.me)
|
PUBLIC_IP=$(curl -sfSL ifconfig.me)
|
||||||
|
|
||||||
|
echo "Downloading configuration..."
|
||||||
|
|
||||||
# download service config
|
# download service config
|
||||||
COMPOSE_CONFIG=$(curl -fsSL https://dl.photoprism.app/docker/cloud/docker-compose.yml)
|
COMPOSE_CONFIG=$(curl -fsSL https://dl.photoprism.app/docker/cloud/docker-compose.yml)
|
||||||
COMPOSE_CONFIG=${COMPOSE_CONFIG//_public_ip_/$PUBLIC_IP}
|
COMPOSE_CONFIG=${COMPOSE_CONFIG//_public_ip_/$PUBLIC_IP}
|
||||||
|
@ -103,6 +110,8 @@ curl -fsSL https://dl.photoprism.app/docker/cloud/traefik.yaml > /opt/photoprism
|
||||||
# change permissions
|
# change permissions
|
||||||
chown -Rf photoprism:photoprism /opt/photoprism
|
chown -Rf photoprism:photoprism /opt/photoprism
|
||||||
|
|
||||||
|
echo "Cleaning up..."
|
||||||
|
|
||||||
# clear package cache
|
# clear package cache
|
||||||
apt-get autoclean
|
apt-get autoclean
|
||||||
apt-get autoremove
|
apt-get autoremove
|
||||||
|
|
Loading…
Reference in a new issue