commit f065300113da8473c6e8d98f0326477c496d90e0
parent dbe5cb2985371a96d96fb7222fd4fe1db80b6d90
Author: James Eversole <james@eversole.co>
Date: Sat, 17 Feb 2024 08:34:26 -0600
Update deployment details
Diffstat:
4 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/README b/README
@@ -33,7 +33,15 @@ own hardware.
DEPLOYMENT
-
+Only Nix build instructions targeting containers are provided below,
+but this project can be built and run without containers or Nix using Cabal.
+
+- Clone this repository
+- Build the container image (with flakes enabled): `nix build .#purr-container`
+- Load the container image
+ - podman load -i result
+- Use the provided docker stack example to deploy the container if desired
+ - docker stack deploy -c docker-stack.yml purr
DEVELOPMENT & SUPPORT
diff --git a/examples/.env.example b/examples/.env.example
@@ -1,7 +1,7 @@
ENVIRONMENT="production"
APPLICATIONHOST="localhost"
APPLICATIONPORT="3000"
-DATAPATH="./"
+DATADIR="./"
DBFILE="data/Purr.sqlite"
LINKLENGTH="24"
ADMINEMAIL="admin@purr.example.com"
diff --git a/examples/docker-stack.yml b/examples/docker-stack.yml
@@ -8,8 +8,8 @@ services:
networks:
- webnet
volumes:
- - ./data/Purr.sqlite:/app/data/Purr.sqlite
- - ./config.dhall:/app/config.dhall
+ - ./data:/app/data
+ - ./.env:/app/.env
networks:
webnet:
diff --git a/flake.nix b/flake.nix
@@ -11,7 +11,7 @@
let
pkgs = nixpkgs.legacyPackages.${system};
packageName = "purr";
- dockerPackageName = "${packageName}-docker";
+ containerPackageName = "${packageName}-container";
haskellPackages = pkgs.haskellPackages;
@@ -37,7 +37,7 @@
};
devShell = self.devShells.${system}.default;
- packages.${dockerPackageName} = pkgs.dockerTools.buildImage {
+ packages.${containerPackageName} = pkgs.dockerTools.buildImage {
name = "purr";
copyToRoot = pkgs.buildEnv {
@@ -50,6 +50,7 @@
Cmd = [
"/bin/Purr"
];
+ WorkingDir = "/app";
ExposedPorts = {
"3000/tcp" = {};
};