- Add app_ports table for storing port mappings per app - Add Port model with CRUD operations - Add handlers for adding/deleting port mappings - Add ports section to app detail template - Update Docker client to configure port bindings when creating containers - Support both TCP and UDP protocols
13 lines
385 B
SQL
13 lines
385 B
SQL
-- Add port mappings for apps
|
|
|
|
CREATE TABLE app_ports (
|
|
id INTEGER PRIMARY KEY,
|
|
app_id TEXT NOT NULL REFERENCES apps(id) ON DELETE CASCADE,
|
|
host_port INTEGER NOT NULL,
|
|
container_port INTEGER NOT NULL,
|
|
protocol TEXT NOT NULL DEFAULT 'tcp' CHECK(protocol IN ('tcp', 'udp')),
|
|
UNIQUE(host_port, protocol)
|
|
);
|
|
|
|
CREATE INDEX idx_app_ports_app_id ON app_ports(app_id);
|