From 0afd03feb03b1e9e308264a3875f6c1c618aed6f Mon Sep 17 00:00:00 2001 From: Jp Date: Fri, 30 Jan 2026 23:42:41 +0800 Subject: [PATCH] chore: add deployment and environment configuration files Add .env.example for environment variable reference, nixpacks.toml for Nixpacks deployment, and docker-compose.yml for containerized deployment. These files provide necessary configuration for running the application in different environments. --- .env.example | 4 ++++ docker-compose.yml | 24 ++++++++++++++++++++++++ nixpacks.toml | 11 +++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .env.example create mode 100644 docker-compose.yml create mode 100644 nixpacks.toml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..2ec1825 --- /dev/null +++ b/.env.example @@ -0,0 +1,4 @@ +PORT=5001 +API_NINJAS_KEY=your_api_key_here +SECRET_KEY=your_secret_key_here +DATABASE_URL=sqlite://calorie_tracker.db diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..1525f7a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +version: '3.8' + +services: + app: + build: . + ports: + - "5000:5000" + volumes: + - calorie_tracker_data:/app/data + environment: + - PORT=5000 + - NODE_ENV=production + # Add other environment variables here or use an env_file + # - API_NINJAS_KEY=your_key_here + # - SECRET_KEY=your_secret_here + restart: always + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:5000/"] + interval: 30s + timeout: 10s + retries: 3 + +volumes: + calorie_tracker_data: diff --git a/nixpacks.toml b/nixpacks.toml new file mode 100644 index 0000000..94ab676 --- /dev/null +++ b/nixpacks.toml @@ -0,0 +1,11 @@ +[phases.setup] +nixPkgs = ["nodejs", "python3", "gcc", "gnumake"] + +[phases.install] +cmds = ["npm install"] + +[phases.build] +cmds = ["mkdir -p data"] + +[start] +cmd = "npm run seed && npm start"