Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ jobs:
run: |
docker build -f Dockerfile -t key-cycle-proxy .

- name: Test Docker image
run: |
# Start container in background
docker run -d --name test-container -p 8080:8080 -e OPENAI_KEYS="sk-test-key" key-cycle-proxy
# Wait for container to start
sleep 5
# Check if container is still running
if ! docker ps | grep test-container; then
echo "Container failed to start"
docker logs test-container
exit 1
fi
echo "Docker image smoke test passed"
# Stop and remove container
docker stop test-container
docker rm test-container

- name: Tag and push bot image
run: |
docker tag key-cycle-proxy:latest ghcr.io/berry-13/key-cycle-proxy:${{ github.sha }}
Expand Down
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# Multi-stage build for Rust application
FROM rust:1.70 as builder
FROM rust:1.82 as builder

# Update CA certificates for HTTPS
RUN apt-get update && \
apt-get install -y ca-certificates && \
rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy dependency files first for better caching
COPY Cargo.toml Cargo.lock ./

# Copy benches directory for Cargo.toml manifest validation
COPY benches ./benches

# Create a dummy main.rs to build dependencies
RUN mkdir src && echo "fn main() {}" > src/main.rs
RUN cargo build --release
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ cargo build --release --locked
### Docker Production

```dockerfile
FROM rust:1.70 as builder
FROM rust:1.82 as builder
WORKDIR /app
COPY . .
RUN cargo build --release
Expand Down
Loading