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
10 changes: 7 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
*
!target/debug/overload
!target/release/overload
target
.vscode
.github
*.log
.git
.idea
docs
25 changes: 9 additions & 16 deletions .github/workflows/dockerhub-push.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Dockerhub

on:
push:
workflow_run:
workflows: ["Rust"]
types: [completed]
branches: [ main ]
release:
types: [published]
Expand All @@ -13,14 +15,10 @@ env:
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- name: install lua
run: sudo apt install -y liblua5.3-dev
- uses: actions/checkout@v2
- name: Run tests for cluster
run: cargo test --features="cluster" --verbose
- uses: actions/checkout@v4
- name: Get version
run: |
if [[ ${{ github.event_name }} == 'release' ]]; then
Expand All @@ -36,27 +34,22 @@ jobs:
echo "version=latest" >> "$GITHUB_ENV"
echo "suffix=-snapshot" >> "$GITHUB_ENV"
fi
- name: Build cluster
run: cargo build --bins --features "cluster" --release
- name: Login to Github Container registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build cluster image
uses: docker/build-push-action@v2.5.0
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:cluster-${{ env.version }}${{ env.suffix }}
- name: Run standalone tests
run: cargo test --verbose
- name: Build standalone
run: cargo build --bins --release
- name: Build & push standalone image
uses: docker/build-push-action@v2.5.0
uses: docker/build-push-action@v7
with:
context: .
file: standalone.Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:standalone-${{ env.version }}${{ env.suffix }}
6 changes: 3 additions & 3 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ jobs:
- name: build mdBook
run: mdbook build docs/
- name: Setup Pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v2
with:
path: 'docs/book/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ env:
jobs:
build:

runs-on: ubuntu-22.04
runs-on: ubuntu-latest

steps:
- name: install lua
run: sudo apt install -y liblua5.3-dev
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ version = "0.14"
version = "0.2"

[profile.release]
debug = true
debug = "line-tables-only"
43 changes: 37 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
FROM ubuntu:20.04
RUN apt update && \
apt install -y openssl liblua5.3-0
ADD target/release/overload /usr/bin/overload
RUN chmod +x /usr/bin/overload
# Build stage
FROM rust:1.96.0-slim-trixie AS builder

# Install build dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
openssl \
libssl-dev \
liblua5.3-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/overload
COPY . .

# Build the application
RUN cargo build --features "cluster" --release

# Runtime stage
FROM debian:trixie-slim

# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
openssl \
liblua5.3-0 \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /usr/bin

# Copy the binary from the builder stage
COPY --from=builder /usr/src/overload/target/release/overload .

# Expose the port the app runs on
EXPOSE 3030
ENTRYPOINT /usr/bin/overload

# Set the startup command
CMD ["/usr/bin/overload"]
38 changes: 38 additions & 0 deletions standalone.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Build stage
FROM rust:1.96.0-slim-trixie AS builder

# Install build dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
openssl \
libssl-dev \
liblua5.3-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/overload
COPY . .

# Build the application
RUN cargo build --release

# Runtime stage
FROM debian:trixie-slim

# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
openssl \
liblua5.3-0 \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /usr/bin

# Copy the binary from the builder stage
COPY --from=builder /usr/src/overload/target/release/overload .

# Expose the port the app runs on
EXPOSE 3030

# Set the startup command
CMD ["/usr/bin/overload"]
Loading