5 Commits
Author SHA1 Message Date
paul 94ede9a168 Use SIGINT as container StopSignal
deliver / deliver (push) Failing after 20s
2025-10-07 13:47:12 +02:00
Paul Brinkmeier c38574e005 Add exec in entrypoint
deliver / deliver (push) Successful in 1m40s
2025-10-07 13:26:46 +02:00
Paul Brinkmeier 700d53fbb0 Update todo list 2025-10-07 13:09:24 +02:00
Paul Brinkmeier c5c11ed181 Don't buffer stdout
deliver / deliver (push) Successful in 1m36s
2025-10-07 12:53:14 +02:00
paul 36c9b880a7 Merge pull request 'Add entrypoint script and cacerts to image' (#2) from image-entry into main
Reviewed-on: #2
2025-10-07 12:50:53 +02:00
4 changed files with 19 additions and 8 deletions
+7 -5
View File
@@ -41,8 +41,10 @@ By setting `$BASE_DIR` you can persist the database for later runs.
## TODO ## TODO
- CI - [x] CI
- Docker container (in flake) - [x] Docker container (in flake)
- try fourmolu - [x] try fourmolu
- Test leap second handling in the `time` package - [x] Test leap second handling in the `time` package
- use queue to sync logging of indexer and main thread - [ ] Fix container shutdown delay
- [ ] Fix `responseFile` always returning 200
- [ ] use queue to sync logging of indexer and main thread
+3
View File
@@ -65,6 +65,7 @@ import Data.Time.Clock.POSIX (getPOSIXTime)
import qualified Envy import qualified Envy
import qualified Yore.DB as DB import qualified Yore.DB as DB
import qualified Yore.Log as Log import qualified Yore.Log as Log
import System.IO (hSetBuffering, BufferMode (..), stdout)
data ConfigT f = Config data ConfigT f = Config
{ yorePort :: f =@@ Int ? 3000 { yorePort :: f =@@ Int ? 3000
@@ -79,6 +80,8 @@ deriving instance Show Config
main :: IO () main :: IO ()
main = do main = do
hSetBuffering stdout NoBuffering
cfg <- cfg <-
Envy.load @ConfigT >>= \case Envy.load @ConfigT >>= \case
Left errs -> do Left errs -> do
+8 -2
View File
@@ -64,19 +64,25 @@
name = "git.pbrinkmeier.de/paul/yore"; name = "git.pbrinkmeier.de/paul/yore";
tag = yore.version; tag = yore.version;
copyToRoot = [ pkgs.cacert ]; copyToRoot = [ pkgs.cacert ];
config.Cmd = [ "${entrypoint}/bin/run" ]; config = {
Cmd = [ "${entrypoint}/bin/run" ];
StopSignal = "SIGINT";
};
}; };
entrypoint = pkgs.writeShellApplication { entrypoint = pkgs.writeShellApplication {
name = "run"; name = "run";
runtimeInputs = [ pkgs.coreutils pkgs.dbmate yore ]; runtimeInputs = [ pkgs.coreutils pkgs.dbmate yore ];
text = '' text = ''
set -Eeuo pipefail
mkdir -p /workspace/db mkdir -p /workspace/db
cp -r ${./db}/* /workspace/db cp -r ${./db}/* /workspace/db
cd /workspace cd /workspace
dbmate up dbmate up
yore # Replace bash and inherit PID 1
exec yore
''; '';
}; };
in { in {
+1 -1
View File
@@ -1,7 +1,7 @@
cabal-version: 3.4 cabal-version: 3.4
name: yore name: yore
version: 0.0.2 version: 0.0.5
author: Paul Brinkmeier author: Paul Brinkmeier
maintainer: hallo@pbrinkmeier.de maintainer: hallo@pbrinkmeier.de
copyright: 2023 Paul Brinkmeier copyright: 2023 Paul Brinkmeier