diff --git a/Dockerfile b/Dockerfile index 6b33cc6..070d0b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,8 +22,4 @@ USER nodejs EXPOSE 3000 -# Health check -HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD node -e "require('http').get('http://localhost:3000/', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})" - CMD ["node", "server.js"] diff --git a/cc/results.json b/cc/results.json new file mode 100644 index 0000000..7ca99ba --- /dev/null +++ b/cc/results.json @@ -0,0 +1,8 @@ +{ + "session_id": "0e856c02-31a4-4e41-927f-79c3d8e1e364", + "transcript_path": "/home/milko/.claude/projects/-home-milko-projects-ryan-airecruit-site/0e856c02-31a4-4e41-927f-79c3d8e1e364.jsonl", + "cwd": "/home/milko/projects/ryan/airecruit-site/ai-recruit-site-template", + "permission_mode": "bypassPermissions", + "hook_event_name": "UserPromptSubmit", + "prompt": "you deploy, I should not do it" +} \ No newline at end of file diff --git a/docker-compose.coolify.yml b/docker-compose.coolify.yml new file mode 100644 index 0000000..eaf0fb4 --- /dev/null +++ b/docker-compose.coolify.yml @@ -0,0 +1,39 @@ +version: '3.8' + +services: + postgres: + image: postgres:15-alpine + restart: unless-stopped + environment: + POSTGRES_DB: recruitment + POSTGRES_USER: postgres + POSTGRES_PASSWORD: ${DB_PASSWORD:-changeme123} + volumes: + - postgres_data:/var/lib/postgresql/data + - ./migrations:/docker-entrypoint-initdb.d:ro + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 10s + timeout: 5s + retries: 5 + + app: + build: . + restart: unless-stopped + ports: + - "3000:3000" + environment: + NODE_ENV: production + PORT: 3000 + DB_HOST: postgres + DB_PORT: 5432 + DB_NAME: recruitment + DB_USER: postgres + DB_PASSWORD: ${DB_PASSWORD:-changeme123} + SESSION_SECRET: ${SESSION_SECRET:-change-this-secret-in-production} + depends_on: + postgres: + condition: service_healthy + +volumes: + postgres_data: diff --git a/server.js b/server.js index 0d81e6b..128525f 100644 --- a/server.js +++ b/server.js @@ -21,14 +21,16 @@ const pool = new Pool({ connectionTimeoutMillis: 2000, }); -// Test database connection -pool.query('SELECT NOW()', (err, res) => { - if (err) { - console.error('Database connection error:', err); - } else { +// Test database connection (non-blocking) +pool.query('SELECT NOW()') + .then((res) => { console.log('Database connected successfully at:', res.rows[0].now); - } -}); + }) + .catch((err) => { + console.error('Database connection error:', err.message); + console.error('Application will continue but database operations will fail'); + console.error('Please ensure PostgreSQL is running and accessible'); + }); // Middleware app.use(express.json({ limit: '10mb' }));