mirror of
				https://gitlab.com/jessieh/simple-shortener.git
				synced 2025-08-18 09:43:36 +00:00 
			
		
		
		
	Move Docker workdir to filesystem root
This commit is contained in:
		
							parent
							
								
									191f8191a9
								
							
						
					
					
						commit
						ab0e290e54
					
				| @ -6,7 +6,7 @@ FROM debian:buster-slim | ||||
| LABEL maintainer='Jessie Hildebrandt <jessieh@jessieh.net>' | ||||
| 
 | ||||
| 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 \ | ||||
|  | ||||
| @ -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)) | ||||
| 
 | ||||
| ;; ---------------------------------- ;; | ||||
|  | ||||
| @ -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)) | ||||
| 
 | ||||
| ;; ---------------------------------- ;; | ||||
|  | ||||
| @ -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=<strong>/PATH/TO/YOUR/SITE</strong>,target=/usr/simple-shortener/static/landing_page,readonly \ | ||||
| --mount source=shortener-db,target=/simple-shortener/db \ | ||||
| --mount type=bind,source=<strong>/PATH/TO/YOUR/SITE</strong>,target=/simple-shortener/static/landing_page,readonly \ | ||||
| jessiehildebrandt/simple-shortener | ||||
|       </code></pre> | ||||
|       <p><code>docker-compose</code> example<sup>1</sup>:</p> | ||||
| @ -54,8 +54,8 @@ simple-shortener: | ||||
|   ports: | ||||
|     - 80:80 | ||||
|   volumes: | ||||
|     - shortener-db:/usr/simple-shortener/db | ||||
|     - <strong>/PATH/TO/YOUR/SITE</strong>:/usr/simple-shortener/static/landing_page:ro | ||||
|     - shortener-db:/simple-shortener/db | ||||
|     - <strong>/PATH/TO/YOUR/SITE</strong>:/simple-shortener/static/landing_page:ro | ||||
| 
 | ||||
| volumes: | ||||
|   shortener-db: | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user