Add base path env

This commit is contained in:
Anton Vakhrushev 2019-11-09 19:27:30 +03:00
parent 988d4b24b4
commit 4f727d10d3
3 changed files with 5 additions and 2 deletions

View File

@ -37,7 +37,7 @@ run: format
.PHONY: run-server
run-server: format
server run $(ENTRY_POINT)
BASE_PATH="./tmp" server run $(ENTRY_POINT)
.PHONY: spec
spec: format

View File

@ -2,7 +2,9 @@ require "kemal"
require "./dayoff/**"
require "./handlers"
base_path = "./tmp"
base_path = ENV["BASE_PATH"]
puts "Set storage base path: " + base_path
app = Dayoff::App.new base_path

View File

@ -14,4 +14,5 @@ docker run -i $TTY \
-v "$PWD:/app" \
-p "3000:3000" \
-w "/app" \
-e "BASE_PATH=$BASE_PATH" \
dayoff-crystal crystal "$@"