added script. fixed bad name for docker rep
This commit is contained in:
20
build_and_push.sh
Normal file
20
build_and_push.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the name of the Docker Compose file
|
||||
COMPOSE_FILE="docker-compose.build.yml"
|
||||
|
||||
# Build the images using docker-compose
|
||||
echo "Building Docker images..."
|
||||
docker-compose -f $COMPOSE_FILE build
|
||||
|
||||
# Check if the build was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Build successful. Pushing images to Docker registry..."
|
||||
# Push the images to the registry
|
||||
docker-compose -f $COMPOSE_FILE push
|
||||
else
|
||||
echo "Build failed. Aborting push to registry."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Images have been built and pushed to the Docker registry."
|
||||
@@ -7,6 +7,7 @@ services:
|
||||
build:
|
||||
context: ../auburnoil_frontend
|
||||
dockerfile: Dockerfile.prod
|
||||
image: docker.io/anekdotin/auburn-oil_frontend:latest
|
||||
ports:
|
||||
- "5180:3000"
|
||||
|
||||
@@ -15,6 +16,7 @@ services:
|
||||
build:
|
||||
context: ../auburnoil_api
|
||||
dockerfile: Dockerfile.prod
|
||||
image: docker.io/anekdotin/auburn-oil_api:latest
|
||||
ports:
|
||||
- '5181:8000'
|
||||
command: 'uvicorn app.main:app --reload --host 0.0.0.0 --port 8000'
|
||||
|
||||
Reference in New Issue
Block a user