#!/usr/bin/env bash # This script will install a codiMD container and associated systemd services on CentOS 7 using podman # Copyright 2022 Bryan C. Roessler # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. database_dir="/var/lib/postgresql/data" [[ ! -d $database_dir ]] && sudo mkdir -p "$database_dir" sudo chcon -t container_file_t -R "$database_dir" podman pod create codiMD podman run --name codidb --pod codiMD -p 3000:3000 -v database-data:/var/lib/postgresql/data docker.io/postgres:11.6-alpine --restart=always podman run --name codidb --pod codiMD -p 3000:3000 -v database-data:/var/lib/postgresql/data docker.io/hackmdio/hackmd:2.4.1 --restart=always podman generate systemd