diff --git a/Dockerfile b/.build/docker/Dockerfile similarity index 78% rename from Dockerfile rename to .build/docker/Dockerfile index 2f29df9..4097894 100644 --- a/Dockerfile +++ b/.build/docker/Dockerfile @@ -10,7 +10,7 @@ RUN bun install EXPOSE 5384 # Entry script to handle conditional startup -COPY ./docker-entrypoint.sh ./docker-entrypoint.sh +COPY .build/docker/docker-entrypoint.sh ./docker-entrypoint.sh RUN chmod +x ./docker-entrypoint.sh ENTRYPOINT ["sh", "./docker-entrypoint.sh"] diff --git a/docker-compose.yml b/.build/docker/docker-compose.yml similarity index 87% rename from docker-compose.yml rename to .build/docker/docker-compose.yml index 4cecb8a..2689c1d 100644 --- a/docker-compose.yml +++ b/.build/docker/docker-compose.yml @@ -1,6 +1,8 @@ services: seda-data-proxy: - build: . + build: + context: ../.. + dockerfile: .build/docker/Dockerfile ports: - "5384:5384" # environment: diff --git a/docker-entrypoint.sh b/.build/docker/docker-entrypoint.sh similarity index 100% rename from docker-entrypoint.sh rename to .build/docker/docker-entrypoint.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a2acaa..f965794 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,9 +8,6 @@ permissions: contents: write packages: write -# env: -# REGISTRY_IMAGE: ghcr.io/${{ github.repository }}/seda-data-proxy - env: REGISTRY: ghcr.io IMAGE_NAME: sedaprotocol/seda-data-proxy @@ -48,6 +45,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . + file: .build/docker/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9eac709 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +.PHONY: build run stop up clean logs ssh + +# Define the docker-compose file location +DOCKER_COMPOSE_FILE := .build/docker/docker-compose.yml + +# Build the Docker image +build: + docker compose -f $(DOCKER_COMPOSE_FILE) build + +# Run the Docker container +run: + docker compose -f $(DOCKER_COMPOSE_FILE) up + +# Stop the Docker container +stop: + docker compose -f $(DOCKER_COMPOSE_FILE) down + +# Build and run the Docker container +up: build run + +# Clean up Docker resources +clean: + docker compose -f $(DOCKER_COMPOSE_FILE) down --rmi all --volumes --remove-orphans + +# Show logs +logs: + docker compose -f $(DOCKER_COMPOSE_FILE) logs -f + +# SSH into the running container +ssh: + docker compose -f $(DOCKER_COMPOSE_FILE) exec seda-data-proxy sh