This commit is contained in:
2026-03-18 14:43:20 +07:00
parent f32c282698
commit dda2151b5c
3 changed files with 38 additions and 8 deletions

View File

@@ -1,23 +1,53 @@
services:
postgres:
db:
image: postgres:16
container_name: app_postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: testdb
ports:
- "5432:5432"
volumes:
- pg_data:/var/lib/postgresql/data
app:
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- app_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
backend:
build: .
container_name: app_backend
restart: unless-stopped
ports:
- "3000:3000"
env_file:
- .env
depends_on:
- postgres
db:
condition: service_healthy
networks:
- app_network
volumes:
pg_data:
postgres_data:
networks:
app_network:
driver: bridge

View File

@@ -1149,4 +1149,4 @@ SELECT * FROM users LIMIT 10;"></textarea>
}
</script>
</body>
</html>
</html>

View File

@@ -363,4 +363,4 @@ app.listen(PORT, () => {
console.log(` Password: ${process.env.ADMIN_PASSWORD || 'admin'}`);
console.log('');
console.log('📝 Make sure to configure your database in .env file');
});
});