36 lines
959 B
Bash
Executable File
36 lines
959 B
Bash
Executable File
#!/bin/bash
|
|
set -xe
|
|
|
|
cd $GOPATH/src/vibeStonk || exit
|
|
|
|
# Build the project first to generate the static assets and server binary
|
|
./scripts/generate_proto.sh
|
|
./scripts/build.sh
|
|
|
|
# Set the image ID (you can replace this with a version or commit hash)
|
|
IMAGE_ID="local"
|
|
|
|
# Registry URL
|
|
REGISTRY="registry.geniuscartel.xyz/stonk"
|
|
|
|
# Build the static image locally
|
|
echo "Building static image locally..."
|
|
docker build \
|
|
-t ${REGISTRY}/static:${IMAGE_ID} \
|
|
-f docker/Dockerfile.static \
|
|
.
|
|
|
|
# Build the API image locally
|
|
echo "Building API image locally..."
|
|
docker build \
|
|
-t ${REGISTRY}/api:${IMAGE_ID} \
|
|
-f docker/Dockerfile.api \
|
|
.
|
|
|
|
echo "Docker images built locally with tag: ${IMAGE_ID}"
|
|
echo "Static image: ${REGISTRY}/static:${IMAGE_ID}"
|
|
echo "API image: ${REGISTRY}/api:${IMAGE_ID}"
|
|
echo ""
|
|
echo "To run the containers locally:"
|
|
echo "docker run -p 8080:80 ${REGISTRY}/static:${IMAGE_ID}"
|
|
echo "docker run -p 8081:8080 ${REGISTRY}/api:${IMAGE_ID}" |