Edwin Salguero commited on
Commit
9fb1755
·
1 Parent(s): 34c9eb0

Add comprehensive Docker Hub integration with deployment scripts and documentation

Browse files
DOCKER_HUB_SETUP.md ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Docker Hub Setup Guide
2
+
3
+ This guide will help you deploy your algorithmic trading system to Docker Hub and use it from the cloud.
4
+
5
+ ## Prerequisites
6
+
7
+ 1. **Docker Hub Account**: Create an account at [hub.docker.com](https://hub.docker.com)
8
+ 2. **Docker CLI**: Ensure Docker is installed and running
9
+ 3. **Repository**: Create a repository on Docker Hub (optional, will be created automatically)
10
+
11
+ ## Quick Start
12
+
13
+ ### 1. Set Environment Variables
14
+
15
+ ```bash
16
+ # Set your Docker Hub username
17
+ export DOCKER_USERNAME=yourusername
18
+
19
+ # Optionally set your password/token (for automated login)
20
+ export DOCKER_PASSWORD=yourpassword
21
+ ```
22
+
23
+ ### 2. Deploy to Docker Hub
24
+
25
+ ```bash
26
+ # Deploy with default settings
27
+ ./scripts/docker-build.sh deploy
28
+
29
+ # Or use the dedicated deployment script
30
+ ./scripts/docker-hub-deploy.sh -u yourusername
31
+
32
+ # Deploy with custom image name and tag
33
+ ./scripts/docker-hub-deploy.sh -u yourusername -i my-trading-system -t v1.0.0
34
+ ```
35
+
36
+ ### 3. Use from Docker Hub
37
+
38
+ ```bash
39
+ # Start services using Docker Hub images
40
+ ./scripts/docker-build.sh hub
41
+
42
+ # Or manually pull and run
43
+ docker pull yourusername/algorithmic-trading:latest
44
+ docker run -p 8000:8000 yourusername/algorithmic-trading:latest
45
+ ```
46
+
47
+ ## Detailed Instructions
48
+
49
+ ### Step 1: Create Docker Hub Account
50
+
51
+ 1. Go to [hub.docker.com](https://hub.docker.com)
52
+ 2. Click "Sign Up" and create an account
53
+ 3. Verify your email address
54
+ 4. Create a repository (optional):
55
+ - Click "Create Repository"
56
+ - Name: `algorithmic-trading`
57
+ - Description: "Algorithmic Trading System with FinRL"
58
+ - Visibility: Public or Private
59
+
60
+ ### Step 2: Generate Access Token (Recommended)
61
+
62
+ 1. Go to Docker Hub → Account Settings → Security
63
+ 2. Click "New Access Token"
64
+ 3. Name: `algorithmic-trading-deploy`
65
+ 4. Permissions: Read & Write
66
+ 5. Copy the token (you won't see it again)
67
+
68
+ ### Step 3: Configure Environment
69
+
70
+ ```bash
71
+ # Add to your ~/.bashrc or ~/.zshrc
72
+ export DOCKER_USERNAME=yourusername
73
+ export DOCKER_PASSWORD=your_access_token
74
+ ```
75
+
76
+ ### Step 4: Deploy
77
+
78
+ ```bash
79
+ # Build and deploy
80
+ ./scripts/docker-hub-deploy.sh -u yourusername
81
+
82
+ # The script will:
83
+ # 1. Build the Docker image
84
+ # 2. Run tests (optional)
85
+ # 3. Login to Docker Hub
86
+ # 4. Tag the image
87
+ # 5. Push to Docker Hub
88
+ ```
89
+
90
+ ### Step 5: Verify Deployment
91
+
92
+ 1. Check your Docker Hub repository: `https://hub.docker.com/r/yourusername/algorithmic-trading`
93
+ 2. You should see your image with the latest tag
94
+
95
+ ## Usage Examples
96
+
97
+ ### Local Development with Docker Hub
98
+
99
+ ```bash
100
+ # Start development environment
101
+ DOCKER_USERNAME=yourusername ./scripts/docker-build.sh hub
102
+
103
+ # Access services:
104
+ # - Jupyter Lab: http://localhost:8888
105
+ # - Trading System: http://localhost:8000
106
+ ```
107
+
108
+ ### Production Deployment
109
+
110
+ ```bash
111
+ # Deploy to production
112
+ docker run -d \
113
+ --name trading-prod \
114
+ -p 8000:8000 \
115
+ -v $(pwd)/data:/app/data \
116
+ -v $(pwd)/logs:/app/logs \
117
+ -v $(pwd)/config.yaml:/app/config.yaml:ro \
118
+ yourusername/algorithmic-trading:latest
119
+ ```
120
+
121
+ ### Using Docker Compose
122
+
123
+ ```bash
124
+ # Create .env file
125
+ echo "DOCKER_USERNAME=yourusername" > .env
126
+ echo "TAG=latest" >> .env
127
+
128
+ # Start services
129
+ docker compose -f docker-compose.hub.yml up -d
130
+ ```
131
+
132
+ ## Advanced Usage
133
+
134
+ ### Multiple Tags
135
+
136
+ ```bash
137
+ # Deploy with version tags
138
+ ./scripts/docker-hub-deploy.sh -u yourusername -t v1.0.0
139
+ ./scripts/docker-hub-deploy.sh -u yourusername -t v1.1.0
140
+ ./scripts/docker-hub-deploy.sh -u yourusername -t latest
141
+ ```
142
+
143
+ ### Custom Image Names
144
+
145
+ ```bash
146
+ # Deploy with custom name
147
+ ./scripts/docker-hub-deploy.sh -u yourusername -i my-trading-bot -t production
148
+ ```
149
+
150
+ ### Automated Deployment
151
+
152
+ ```bash
153
+ # Create a deployment script
154
+ cat > deploy.sh << 'EOF'
155
+ #!/bin/bash
156
+ export DOCKER_USERNAME=yourusername
157
+ export DOCKER_PASSWORD=your_token
158
+ ./scripts/docker-hub-deploy.sh -u $DOCKER_USERNAME -t $(date +%Y%m%d)
159
+ EOF
160
+
161
+ chmod +x deploy.sh
162
+ ./deploy.sh
163
+ ```
164
+
165
+ ## Troubleshooting
166
+
167
+ ### Login Issues
168
+
169
+ ```bash
170
+ # Manual login
171
+ docker login -u yourusername
172
+
173
+ # Check login status
174
+ docker info | grep Username
175
+ ```
176
+
177
+ ### Push Failures
178
+
179
+ ```bash
180
+ # Check if repository exists
181
+ curl https://hub.docker.com/v2/repositories/yourusername/algorithmic-trading/
182
+
183
+ # Create repository manually if needed
184
+ # Go to Docker Hub → Create Repository
185
+ ```
186
+
187
+ ### Permission Issues
188
+
189
+ ```bash
190
+ # Check Docker permissions
191
+ docker ps
192
+
193
+ # If permission denied, add user to docker group
194
+ sudo usermod -aG docker $USER
195
+ # Log out and back in
196
+ ```
197
+
198
+ ### Network Issues
199
+
200
+ ```bash
201
+ # Check Docker Hub connectivity
202
+ curl -I https://hub.docker.com
203
+
204
+ # Use different DNS if needed
205
+ echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf
206
+ ```
207
+
208
+ ## Best Practices
209
+
210
+ ### 1. Use Access Tokens
211
+ - Never use your password in scripts
212
+ - Generate access tokens with limited permissions
213
+ - Rotate tokens regularly
214
+
215
+ ### 2. Tag Strategically
216
+ - Use semantic versioning: `v1.0.0`, `v1.1.0`
217
+ - Keep `latest` tag updated
218
+ - Use date tags for testing: `2024-01-15`
219
+
220
+ ### 3. Security
221
+ - Don't commit credentials to git
222
+ - Use environment variables
223
+ - Consider private repositories for sensitive code
224
+
225
+ ### 4. Automation
226
+ - Set up CI/CD pipelines
227
+ - Automate testing before deployment
228
+ - Use GitHub Actions or similar
229
+
230
+ ## CI/CD Integration
231
+
232
+ ### GitHub Actions Example
233
+
234
+ ```yaml
235
+ # .github/workflows/docker-hub.yml
236
+ name: Deploy to Docker Hub
237
+
238
+ on:
239
+ push:
240
+ tags: ['v*']
241
+
242
+ jobs:
243
+ deploy:
244
+ runs-on: ubuntu-latest
245
+ steps:
246
+ - uses: actions/checkout@v2
247
+ - name: Login to Docker Hub
248
+ uses: docker/login-action@v1
249
+ with:
250
+ username: ${{ secrets.DOCKER_USERNAME }}
251
+ password: ${{ secrets.DOCKER_PASSWORD }}
252
+ - name: Build and push
253
+ run: |
254
+ docker build -t ${{ secrets.DOCKER_USERNAME }}/algorithmic-trading:${{ github.ref_name }} .
255
+ docker push ${{ secrets.DOCKER_USERNAME }}/algorithmic-trading:${{ github.ref_name }}
256
+ ```
257
+
258
+ ## Support
259
+
260
+ - **Docker Hub Documentation**: [docs.docker.com/docker-hub](https://docs.docker.com/docker-hub/)
261
+ - **Repository Issues**: Create an issue in this repository
262
+ - **Community**: Join Docker Hub community forums
263
+
264
+ ## Next Steps
265
+
266
+ 1. **Set up automated deployment** with CI/CD
267
+ 2. **Create multiple environments** (dev, staging, prod)
268
+ 3. **Monitor usage** with Docker Hub analytics
269
+ 4. **Share with team** by adding collaborators
270
+ 5. **Scale deployment** to multiple servers
docker-compose.hub.yml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '3.8'
2
+
3
+ services:
4
+ # Main trading system using Docker Hub image
5
+ trading-system:
6
+ image: ${DOCKER_USERNAME:-yourusername}/algorithmic-trading:${TAG:-latest}
7
+ container_name: algorithmic-trading-hub
8
+ ports:
9
+ - "8000:8000"
10
+ volumes:
11
+ - ./data:/app/data
12
+ - ./logs:/app/logs
13
+ - ./models:/app/models
14
+ - ./config.yaml:/app/config.yaml:ro
15
+ environment:
16
+ - PYTHONPATH=/app
17
+ - LOG_LEVEL=INFO
18
+ command: ["python", "-m", "agentic_ai_system.main", "--mode", "live", "--duration", "300"]
19
+ restart: unless-stopped
20
+ healthcheck:
21
+ test: ["CMD", "python", "-c", "import sys; sys.exit(0)"]
22
+ interval: 30s
23
+ timeout: 10s
24
+ retries: 3
25
+ start_period: 40s
26
+
27
+ # Development environment with Jupyter Lab
28
+ development:
29
+ image: ${DOCKER_USERNAME:-yourusername}/algorithmic-trading:${TAG:-latest}
30
+ container_name: trading-dev-hub
31
+ ports:
32
+ - "8888:8888"
33
+ volumes:
34
+ - ./data:/app/data
35
+ - ./logs:/app/logs
36
+ - ./models:/app/models
37
+ - ./config.yaml:/app/config.yaml:ro
38
+ - .:/app
39
+ environment:
40
+ - PYTHONPATH=/app
41
+ - LOG_LEVEL=DEBUG
42
+ command: ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root", "--NotebookApp.token=''"]
43
+ restart: unless-stopped
44
+
45
+ # FinRL training service
46
+ finrl-training:
47
+ image: ${DOCKER_USERNAME:-yourusername}/algorithmic-trading:${TAG:-latest}
48
+ container_name: finrl-training-hub
49
+ volumes:
50
+ - ./data:/app/data
51
+ - ./logs:/app/logs
52
+ - ./models:/app/models
53
+ - ./config.yaml:/app/config.yaml:ro
54
+ environment:
55
+ - PYTHONPATH=/app
56
+ - LOG_LEVEL=INFO
57
+ command: ["python", "finrl_demo.py"]
58
+ restart: "no"
59
+
60
+ volumes:
61
+ data:
62
+ logs:
63
+ models:
scripts/docker-build.sh CHANGED
@@ -108,17 +108,21 @@ show_help() {
108
  echo " test Run tests in Docker"
109
  echo " dev Start development environment"
110
  echo " prod Start production environment"
 
111
  echo " stop Stop all containers"
112
  echo " cleanup Clean up Docker resources"
113
  echo " logs [SVC] Show logs for a service (default: trading-system)"
114
  echo " run CMD Run a specific command in the container"
 
115
  echo " help Show this help message"
116
  echo ""
117
  echo "Examples:"
118
  echo " $0 build"
119
  echo " $0 dev"
 
120
  echo " $0 logs"
121
  echo " $0 run 'python demo.py'"
 
122
  }
123
 
124
  # Main script logic
@@ -156,6 +160,27 @@ case "${1:-help}" in
156
  build_image
157
  run_command "$2"
158
  ;;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  help|*)
160
  show_help
161
  ;;
 
108
  echo " test Run tests in Docker"
109
  echo " dev Start development environment"
110
  echo " prod Start production environment"
111
+ echo " hub Start using Docker Hub images"
112
  echo " stop Stop all containers"
113
  echo " cleanup Clean up Docker resources"
114
  echo " logs [SVC] Show logs for a service (default: trading-system)"
115
  echo " run CMD Run a specific command in the container"
116
+ echo " deploy Deploy to Docker Hub (requires docker-hub-deploy.sh)"
117
  echo " help Show this help message"
118
  echo ""
119
  echo "Examples:"
120
  echo " $0 build"
121
  echo " $0 dev"
122
+ echo " $0 hub"
123
  echo " $0 logs"
124
  echo " $0 run 'python demo.py'"
125
+ echo " $0 deploy"
126
  }
127
 
128
  # Main script logic
 
160
  build_image
161
  run_command "$2"
162
  ;;
163
+ hub)
164
+ print_status "Starting services using Docker Hub images..."
165
+ if [ -z "$DOCKER_USERNAME" ]; then
166
+ print_error "DOCKER_USERNAME environment variable not set"
167
+ print_status "Please set it: export DOCKER_USERNAME=yourusername"
168
+ exit 1
169
+ fi
170
+ docker compose -f docker-compose.hub.yml up -d
171
+ print_success "Docker Hub services started"
172
+ print_status "Trading system available at: http://localhost:8000"
173
+ print_status "Jupyter Lab available at: http://localhost:8888"
174
+ ;;
175
+ deploy)
176
+ print_status "Deploying to Docker Hub..."
177
+ if [ -f "scripts/docker-hub-deploy.sh" ]; then
178
+ ./scripts/docker-hub-deploy.sh "$@"
179
+ else
180
+ print_error "docker-hub-deploy.sh not found"
181
+ exit 1
182
+ fi
183
+ ;;
184
  help|*)
185
  show_help
186
  ;;
scripts/docker-hub-deploy.sh ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Colors for output
4
+ RED='\033[0;31m'
5
+ GREEN='\033[0;32m'
6
+ YELLOW='\033[1;33m'
7
+ BLUE='\033[0;34m'
8
+ NC='\033[0m' # No Color
9
+
10
+ # Function to print colored output
11
+ print_status() {
12
+ echo -e "${BLUE}[INFO]${NC} $1"
13
+ }
14
+
15
+ print_success() {
16
+ echo -e "${GREEN}[SUCCESS]${NC} $1"
17
+ }
18
+
19
+ print_warning() {
20
+ echo -e "${YELLOW}[WARNING]${NC} $1"
21
+ }
22
+
23
+ print_error() {
24
+ echo -e "${RED}[ERROR]${NC} $1"
25
+ }
26
+
27
+ # Default values
28
+ DOCKER_USERNAME=""
29
+ IMAGE_NAME="algorithmic-trading"
30
+ TAG="latest"
31
+ REGISTRY="docker.io"
32
+
33
+ # Function to show help
34
+ show_help() {
35
+ echo "Usage: $0 [OPTIONS]"
36
+ echo ""
37
+ echo "Options:"
38
+ echo " -u, --username USERNAME Docker Hub username (required)"
39
+ echo " -i, --image IMAGE_NAME Image name (default: algorithmic-trading)"
40
+ echo " -t, --tag TAG Tag (default: latest)"
41
+ echo " -r, --registry REGISTRY Registry URL (default: docker.io)"
42
+ echo " -h, --help Show this help message"
43
+ echo ""
44
+ echo "Examples:"
45
+ echo " $0 -u myusername"
46
+ echo " $0 -u myusername -i my-trading-system -t v1.0.0"
47
+ echo ""
48
+ echo "Environment Variables:"
49
+ echo " DOCKER_USERNAME Set your Docker Hub username"
50
+ echo " DOCKER_PASSWORD Set your Docker Hub password/token"
51
+ }
52
+
53
+ # Parse command line arguments
54
+ while [[ $# -gt 0 ]]; do
55
+ case $1 in
56
+ -u|--username)
57
+ DOCKER_USERNAME="$2"
58
+ shift 2
59
+ ;;
60
+ -i|--image)
61
+ IMAGE_NAME="$2"
62
+ shift 2
63
+ ;;
64
+ -t|--tag)
65
+ TAG="$2"
66
+ shift 2
67
+ ;;
68
+ -r|--registry)
69
+ REGISTRY="$2"
70
+ shift 2
71
+ ;;
72
+ -h|--help)
73
+ show_help
74
+ exit 0
75
+ ;;
76
+ *)
77
+ print_error "Unknown option: $1"
78
+ show_help
79
+ exit 1
80
+ ;;
81
+ esac
82
+ done
83
+
84
+ # Check if username is provided
85
+ if [ -z "$DOCKER_USERNAME" ]; then
86
+ if [ -n "$DOCKER_USERNAME" ]; then
87
+ DOCKER_USERNAME="$DOCKER_USERNAME"
88
+ else
89
+ print_error "Docker Hub username is required!"
90
+ echo "Use -u option or set DOCKER_USERNAME environment variable"
91
+ show_help
92
+ exit 1
93
+ fi
94
+ fi
95
+
96
+ # Function to build the image
97
+ build_image() {
98
+ print_status "Building Docker image..."
99
+ docker build -t ${IMAGE_NAME}:${TAG} .
100
+ if [ $? -eq 0 ]; then
101
+ print_success "Docker image built successfully"
102
+ else
103
+ print_error "Failed to build Docker image"
104
+ exit 1
105
+ fi
106
+ }
107
+
108
+ # Function to login to Docker Hub
109
+ login_to_dockerhub() {
110
+ print_status "Logging in to Docker Hub..."
111
+ if [ -n "$DOCKER_PASSWORD" ]; then
112
+ echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
113
+ else
114
+ docker login -u "$DOCKER_USERNAME"
115
+ fi
116
+
117
+ if [ $? -eq 0 ]; then
118
+ print_success "Successfully logged in to Docker Hub"
119
+ else
120
+ print_error "Failed to login to Docker Hub"
121
+ exit 1
122
+ fi
123
+ }
124
+
125
+ # Function to tag the image
126
+ tag_image() {
127
+ local full_image_name="${REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${TAG}"
128
+ print_status "Tagging image as: $full_image_name"
129
+ docker tag ${IMAGE_NAME}:${TAG} "$full_image_name"
130
+ if [ $? -eq 0 ]; then
131
+ print_success "Image tagged successfully"
132
+ echo "$full_image_name"
133
+ else
134
+ print_error "Failed to tag image"
135
+ exit 1
136
+ fi
137
+ }
138
+
139
+ # Function to push the image
140
+ push_image() {
141
+ local full_image_name="${REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${TAG}"
142
+ print_status "Pushing image to Docker Hub: $full_image_name"
143
+ docker push "$full_image_name"
144
+ if [ $? -eq 0 ]; then
145
+ print_success "Image pushed successfully to Docker Hub!"
146
+ print_status "You can now pull it with:"
147
+ echo " docker pull $full_image_name"
148
+ print_status "Or use it in docker-compose with:"
149
+ echo " image: $full_image_name"
150
+ else
151
+ print_error "Failed to push image to Docker Hub"
152
+ exit 1
153
+ fi
154
+ }
155
+
156
+ # Function to run tests before pushing
157
+ run_tests() {
158
+ print_status "Running tests before deployment..."
159
+ docker run --rm -v $(pwd):/app ${IMAGE_NAME}:${TAG} pytest -v --tb=short
160
+ if [ $? -eq 0 ]; then
161
+ print_success "Tests passed"
162
+ else
163
+ print_warning "Some tests failed, but continuing with deployment..."
164
+ fi
165
+ }
166
+
167
+ # Function to clean up local images
168
+ cleanup() {
169
+ print_status "Cleaning up local images..."
170
+ docker rmi ${IMAGE_NAME}:${TAG} 2>/dev/null || true
171
+ print_success "Cleanup completed"
172
+ }
173
+
174
+ # Main deployment process
175
+ main() {
176
+ print_status "Starting Docker Hub deployment..."
177
+ print_status "Username: $DOCKER_USERNAME"
178
+ print_status "Image: $IMAGE_NAME"
179
+ print_status "Tag: $TAG"
180
+ print_status "Registry: $REGISTRY"
181
+ echo ""
182
+
183
+ # Build the image
184
+ build_image
185
+
186
+ # Run tests (optional)
187
+ read -p "Run tests before deployment? (y/n): " -n 1 -r
188
+ echo
189
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
190
+ run_tests
191
+ fi
192
+
193
+ # Login to Docker Hub
194
+ login_to_dockerhub
195
+
196
+ # Tag the image
197
+ local full_image_name=$(tag_image)
198
+
199
+ # Push the image
200
+ push_image
201
+
202
+ # Cleanup
203
+ read -p "Clean up local images? (y/n): " -n 1 -r
204
+ echo
205
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
206
+ cleanup
207
+ fi
208
+
209
+ print_success "Deployment completed successfully!"
210
+ print_status "Your image is now available at:"
211
+ echo " https://hub.docker.com/r/${DOCKER_USERNAME}/${IMAGE_NAME}"
212
+ }
213
+
214
+ # Run main function
215
+ main "$@"