help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
rust-web-server
RSK World
rust-web-server
Rust Web Server - High-Performance Async Web Server + WebSocket Support + JWT Authentication + File Upload + Memory Safety + Educational Design
rust-web-server
  • .github
  • .vscode
  • benches
  • docs
  • src
  • static
  • tests
  • .dockerignore611 B
  • .editorconfig735 B
  • .env.example676 B
  • .gitignore1.4 KB
  • CHANGELOG.md2 KB
  • CONTRIBUTING.md3.3 KB
  • Cargo.toml1.7 KB
  • Dockerfile1.1 KB
  • LICENSE1.4 KB
  • Makefile2.4 KB
  • README.md7.9 KB
  • SECURITY.md3.2 KB
  • clippy.toml946 B
  • config.toml.example1.3 KB
  • docker-compose.yml380 B
  • rustfmt.toml1.5 KB
Dockerfile
Dockerfile
Raw Download
Find: Go to:
# Use the official Rust image as the base image
FROM rust:1.75-slim as builder

# Set the working directory
WORKDIR /app

# Copy the Cargo.toml and Cargo.lock files
COPY Cargo.toml Cargo.lock ./

# Copy the source code
COPY src ./src

# Build the application in release mode
RUN cargo build --release

# Use a smaller base image for the final image
FROM debian:bookworm-slim

# Install runtime dependencies
RUN apt-get update && apt-get install -y \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

# Create a non-root user
RUN useradd -r -s /bin/false rustuser

# Set the working directory
WORKDIR /app

# Copy the compiled binary from the builder stage
COPY --from=builder /app/target/release/server /app/server

# Copy static files
COPY static ./static

# Change ownership of the app directory to the rustuser
RUN chown -R rustuser:rustuser /app

# Switch to the non-root user
USER rustuser

# Expose the port the app runs on
EXPOSE 8080

# Set environment variables
ENV RUST_LOG=info

# Command to run the application
CMD ["./server"]
49 lines•1.1 KB
text

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer