From ab0e290e54cf228ee71fcafcd10fa2b9abeff941 Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Tue, 21 Dec 2021 02:03:58 -0500 Subject: [PATCH] Move Docker workdir to filesystem root --- Dockerfile | 2 +- src/modules/links_db.fnl | 2 +- src/modules/sessions_db.fnl | 2 +- src/static/landing_page/index.html | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1a37acc..4412f26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ FROM debian:buster-slim LABEL maintainer='Jessie Hildebrandt ' ENV PORT 80 -WORKDIR /usr/simple-shortener +WORKDIR /simple-shortener # Install required packages for building luarocks and lua rocks RUN apt-get update && apt-get install --no-install-recommends -y \ diff --git a/src/modules/links_db.fnl b/src/modules/links_db.fnl index cbdce1f..2f5f33c 100644 --- a/src/modules/links_db.fnl +++ b/src/modules/links_db.fnl @@ -48,7 +48,7 @@ ORDER BY created DESC") ;; Ensure 'db/' folder exists (when (not (fs_utils.dir_exists? "db")) - (print "🚨 ERROR: No 'db/' folder to place SQLite database files in.\n❓ Did you forget to mount a volume at '/usr/simple-shortener/db?'") + (print "🚨 ERROR: No 'db/' folder to place SQLite database files in.\n❓ Did you forget to mount a volume at '/simple-shortener/db'?") (os.exit -1)) ;; ---------------------------------- ;; diff --git a/src/modules/sessions_db.fnl b/src/modules/sessions_db.fnl index 5068cb0..a9e6f0c 100644 --- a/src/modules/sessions_db.fnl +++ b/src/modules/sessions_db.fnl @@ -43,7 +43,7 @@ OR last_active <= strftime('%s', 'now', '-" config.session_max_idle_length_hours ;; Ensure 'db/' folder exists (when (not (fs_utils.dir_exists? "db")) - (print "🚨 ERROR: No 'db/' folder to place SQLite database files in.\n❓ Did you forget to mount a volume at '/usr/simple-shortener/db?'") + (print "🚨 ERROR: No 'db/' folder to place SQLite database files in.\n❓ Did you forget to mount a volume at '/simple-shortener/db'?") (os.exit -1)) ;; ---------------------------------- ;; diff --git a/src/static/landing_page/index.html b/src/static/landing_page/index.html index 510b9b0..f19f0ef 100644 --- a/src/static/landing_page/index.html +++ b/src/static/landing_page/index.html @@ -42,8 +42,8 @@ docker run -d \ -p 80:80 \ --env-file config.env \ ---mount source=shortener-db,target=/usr/simple-shortener/db \ ---mount type=bind,source=/PATH/TO/YOUR/SITE,target=/usr/simple-shortener/static/landing_page,readonly \ +--mount source=shortener-db,target=/simple-shortener/db \ +--mount type=bind,source=/PATH/TO/YOUR/SITE,target=/simple-shortener/static/landing_page,readonly \ jessiehildebrandt/simple-shortener

docker-compose example1:

@@ -54,8 +54,8 @@ simple-shortener: ports: - 80:80 volumes: - - shortener-db:/usr/simple-shortener/db - - /PATH/TO/YOUR/SITE:/usr/simple-shortener/static/landing_page:ro + - shortener-db:/simple-shortener/db + - /PATH/TO/YOUR/SITE:/simple-shortener/static/landing_page:ro volumes: shortener-db: