diff --git a/.env b/.env index f847706..a55592e 100644 --- a/.env +++ b/.env @@ -3,11 +3,14 @@ PORT=3000 # MariaDB connection DB_CLIENT=mysql -DB_HOST=localhost -DB_PORT=3306 -DB_USER=your_db_user -DB_PASSWORD=your_db_password -DB_NAME=warehouse_heatmap +DB_HOST=0.0.0.0 +DB_PORT=3307 +DB_USER=joshbaney +DB_PASSWORD=Ran0dal5! +DB_NAME=heatmap # Slack Incoming Webhook URL -SLACK_WEBHOOK_URL=https://hooks.slack.com/services/XXX/YYY/ZZZ \ No newline at end of file +SLACK_WEBHOOK_URL=https://hooks.slack.com/triggers/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 + +AWS s3 +S3_BUCKET_URL=https://s3.amazonaws.com/your‐bucket/trends diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..26c51a8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# Use official Node.js 18 LTS alpine image +FROM node:18-alpine + +# Create app directory +WORKDIR /app + +# Install app dependencies +COPY package*.json ./ +RUN npm install --production + +# Copy source +COPY . . + +# Expose port +EXPOSE 3000 + +# Start the server +CMD ["npm", "start"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..f7f64bc --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,32 @@ +version: '3.8' + +services: + db: + image: mariadb:10.11 + restart: always + environment: + MYSQL_ROOT_PASSWORD: example_root_password + MYSQL_DATABASE: heat_tracker + MYSQL_USER: heat_user + MYSQL_PASSWORD: StrongP@ssw0rd + volumes: + - db_data:/var/lib/mysql + + app: + build: . + restart: always + ports: + - "3000:3000" + env_file: + - .env + environment: + # override DB_HOST to point at our db service + DB_HOST: db + DB_PORT: 3306 + depends_on: + - db + volumes: + - .:/app + +volumes: + db_data: diff --git a/package.json b/package.json index 7b4219f..7e8fe9b 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,18 @@ { - "name": "warehouse-heatmap-app", - "version": "1.0.0", - "main": "server.js", - "scripts": { - "start": "node server.js" - }, - "dependencies": { - "express": "^4.18.2", - "mysql2": "^3.2.0", - "knex": "^2.4.2", - "body-parser": "^1.20.2", - "dotenv": "^16.0.0", - "axios": "^1.3.0" - } - } \ No newline at end of file + "name": "Amazon-Fuego", + "version": "1.0.0", + "main": "server.js", + "scripts": { + "start": "node server.js" + }, + "dependencies": { + "@aws-sdk/client-s3": "^3.300.0", + "axios": "^1.4.0", + "body-parser": "^1.20.2", + "csv-stringify": "^6.0.8", + "dotenv": "^16.3.1", + "express": "^4.18.2", + "mysql2": "^3.3.3", + "sqlite3": "^5.1.6" + } +} diff --git a/public/heatmap.html b/public/heatmap.html index c2d9e75..b2b7460 100644 --- a/public/heatmap.html +++ b/public/heatmap.html @@ -5,24 +5,35 @@ -