Skip to content

Commit

Permalink
fix docker flow
Browse files Browse the repository at this point in the history
  • Loading branch information
girorme committed Dec 4, 2023
1 parent e8c1f28 commit 0fccb36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ FROM bitwalker/alpine-elixir:latest
# Set the working directory inside the container
WORKDIR /app

ENV PROD=true

# Copy from builder stage
COPY --from=builder /app/bin/binoculo /app/bin/binoculo
COPY binoculo /app/binoculo.sh

# Set the entry point and command to run when the container starts
ENTRYPOINT ["/bin/bash", "binoculo.sh"]
ENTRYPOINT ["/app/bin/binoculo"]
CMD ["--help"] # Provide a default argument to show usage info
8 changes: 4 additions & 4 deletions binoculo
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ build_tool() {
NETWORK_NAME="binoculo-network"
MEILISEARCH_CONTAINER="meilisearch"

echo -e "${YELLOW}Setting up Meilisearch and binoculo...${NC}"

# Check if the flag for build is passed
if [[ "$1" == "-b" ]]; then
build_tool
Expand All @@ -36,6 +34,8 @@ if ! docker network inspect "$NETWORK_NAME" &> /dev/null; then
docker network create "$NETWORK_NAME"
fi

echo -e "${YELLOW}Setting up Meilisearch and binoculo...${NC}"

# Check if the Meilisearch container already exists
if ! docker inspect "$MEILISEARCH_CONTAINER" &> /dev/null; then
# Run Meilisearch container if it doesn't exist
Expand All @@ -49,6 +49,6 @@ fi
# Run your tool container linked to the same network with user-provided arguments
echo -e "${YELLOW}Launching binoculo${NC}"

docker run --rm --network="$NETWORK_NAME" ghcr.io/girorme/binoculo:main "$@"
docker run --rm --pull always --network="$NETWORK_NAME" ghcr.io/girorme/binoculo:main "$@"

echo -e "${GREEN}Your-tool execution completed.${NC}"
echo -e "${GREEN}Binoculo execution completed.${NC}"

0 comments on commit 0fccb36

Please sign in to comment.