-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (42 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
51 lines (42 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Use Ubuntu 24.04 as base image
FROM ubuntu:24.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV RUSTUP_HOME=/usr/local/rustup
ENV CARGO_HOME=/usr/local/cargo
ENV PATH=/usr/local/cargo/bin:$PATH
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
build-essential \
python3.12 \
python3.12-dev \
python3.12-venv \
python3-pip \
nodejs \
npm \
git \
libssl-dev \
pkg-config \
libsqlite3-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& rustup default stable \
&& rustup target add wasm32-unknown-unknown
# Set up Python virtual environment
RUN python3.12 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# Install Python dependencies
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r /app/requirements.txt
# Set up the application
WORKDIR /app
COPY . /app/
# Build the application
RUN cargo build --release
# Expose port
EXPOSE 8000
# Run the application
CMD ["cargo", "run", "--release"]