Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
AnonCatalyst authored Aug 12, 2024
1 parent 57d9e92 commit 6d08379
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,30 @@ RUN apt-get update \
build-essential \
libffi-dev \
curl \
rustc \
cargo \
&& rm -rf /var/lib/apt/lists/*

# Install Rust and Cargo
FROM base AS rust

# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

# Set the environment variable for Rust
ENV PATH="/root/.cargo/bin:${PATH}"

# Verify installation
RUN rustc --version \
&& cargo --version \
&& rustfmt --version

# Set the working directory
WORKDIR /app

# Copy the package files and install Python dependencies
# Install Python dependencies
COPY requirements.txt .
RUN pip install --upgrade pip \
&& pip install build twine \
&& pip install -r requirements.txt
&& pip install -r requirements.txt --break-system-packages

# Copy the rest of the application code
COPY . .

# Build the package
RUN python -m build

# Remove temporary files
# Clean up
RUN apt-get purge -y build-essential \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /root/.cargo /root/.rustup
&& rm -rf /var/lib/apt/lists/*

# Set the entry point
ENTRYPOINT ["python", "-m", "build"]
Expand Down

0 comments on commit 6d08379

Please sign in to comment.