diff --git a/README.md b/README.md index fe91484..1c3cda0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ # purchase-orders +The HHE purchase orders application. + +## Usage + +1. Download the compose file or use your container orchestration tool. +2. Copy the `example.env` values and set appropriately. +3. Deploy the application. diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..fd62f87 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,33 @@ +services: + purchase_orders: + image: git.housh.dev/hhe/vapor-po:prod + container_name: purchase_orders + restart: unless-stopped + environment: + LOG_LEVEL: ${LOG_LEVEL:-debug} + SQLITE_FILENAME: ${SQLITE_FILENAME:-/data/db.sqlite} + volumes: + - purchase_order_data:/data + networks: + - proxy + ports: + - 8082:8080 + healthcheck: + test: curl --fail -s http://0.0.0.0:8080/health || exit 1 + interval: 1m + timeout: 10s + retries: 3 + command: ["serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "8080"] + +networks: + proxy: + external: true + +volumes: + purchase_order_data: + driver_opts: + type: "nfs" + o: "addr=${NFS_ADDR},nolock,soft,rw" + device: "${NFS_MNT}" + labels: + dev.housh.description: "Purchase orders database volume." diff --git a/example.env b/example.env new file mode 100644 index 0000000..ca25bde --- /dev/null +++ b/example.env @@ -0,0 +1,4 @@ +LOG_LEVEL=debug # info | debug | warning | trace | error +SQLITE_FILENAME=/data/db.sqlite +NFS_ADDR=nas.local +NFS_MNT=":/var/nfs/shared/"