Skip to content

Commit

Permalink
add support for docker image build on each new release
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeantonio21 committed Dec 13, 2024
1 parent e9c4e72 commit fc21919
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ POSTGRES_PASSWORD=
POSTGRES_PORT=5432

TRACE_LEVEL=info
ATOMA_PROXY_CONFIG_PATH=./config.toml
Empty file added .github/workflows/release.yml
Empty file.
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Builder stage
FROM rust:1.83-slim-bullseye as builder
FROM --platform=$BUILDPLATFORM rust:1.83-slim-bullseye AS builder

# Add platform-specific arguments
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETARCH

# Trace level argument
ARG TRACE_LEVEL

# Install build dependencies
Expand All @@ -15,11 +21,11 @@ WORKDIR /usr/src/atoma-proxy

COPY . .

# Build the application
# Compile
RUN RUST_LOG=${TRACE_LEVEL} cargo build --release --bin atoma-proxy

# Final stage
FROM debian:bullseye-slim
FROM --platform=$TARGETPLATFORM debian:bullseye-slim

# Install runtime dependencies
RUN apt-get update && apt-get install -y \
Expand All @@ -36,9 +42,6 @@ RUN mkdir -p /app/logs
# Copy the built binary from builder stage
COPY --from=builder /usr/src/atoma-proxy/target/release/atoma-proxy /usr/local/bin/atoma-proxy

# Copy configuration file
COPY config.toml ./config.toml

# Set executable permissions explicitly
RUN chmod +x /usr/local/bin/atoma-proxy

Expand All @@ -49,5 +52,4 @@ RUN chmod +x /usr/local/bin/entrypoint.sh
# Copy host client.yaml and modify keystore path
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

# Use full path in CMD
CMD ["/usr/local/bin/atoma-proxy", "--config-path", "/app/config.toml"]
3 changes: 2 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ services:
- atoma-network

atoma-proxy:
image: ghcr.io/atoma-network/atoma-proxy:latest
build:
context: .
dockerfile: Dockerfile
args:
TRACE_LEVEL: ${TRACE_LEVEL:-info}
volumes:
- ./config.toml:/app/config.toml
- ${CONFIG_PATH:-./config.toml}:/app/config.toml
- ./logs:/app/logs
- ${SUI_CONFIG_PATH:-~/.sui/sui_config}:/root/.sui/sui_config
env_file:
Expand Down

0 comments on commit fc21919

Please sign in to comment.