Xocen commited on
Commit
edcc92b
·
verified ·
1 Parent(s): ed77ac8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -10
Dockerfile CHANGED
@@ -8,16 +8,16 @@ RUN apt-get update && apt-get install -y git pkg-config libssl-dev
8
  WORKDIR /app
9
  RUN git clone https://github.com/engineer-man/piston.git .
10
 
11
- # Move into the API directory
12
- WORKDIR /app/api
13
 
14
  # Build the API binary
15
  RUN cargo build --release
16
 
17
- # Stage 2: Minimal runtime image
18
  FROM debian:bullseye-slim
19
 
20
- # Install Docker CLI (for running sandboxed code)
21
  RUN apt-get update && \
22
  apt-get install -y curl gnupg lsb-release && \
23
  curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
@@ -27,15 +27,15 @@ RUN apt-get update && \
27
  # Working directory
28
  WORKDIR /app
29
 
30
- # Copy the built binary
31
- COPY --from=builder /app/api/target/release/piston-api /usr/local/bin/piston
32
 
33
- # Copy runtime config
34
- COPY --from=builder /app/api/Runtimes.toml ./Runtimes.toml
35
 
36
- # Set the port
37
  ENV PORT=7860
38
  EXPOSE 7860
39
 
40
- # Launch the Piston API
41
  CMD ["piston"]
 
8
  WORKDIR /app
9
  RUN git clone https://github.com/engineer-man/piston.git .
10
 
11
+ # Move into the correct directory (engine/)
12
+ WORKDIR /app/engine
13
 
14
  # Build the API binary
15
  RUN cargo build --release
16
 
17
+ # Stage 2: Runtime image
18
  FROM debian:bullseye-slim
19
 
20
+ # Install Docker CLI (used by Piston to run sandboxed code)
21
  RUN apt-get update && \
22
  apt-get install -y curl gnupg lsb-release && \
23
  curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
 
27
  # Working directory
28
  WORKDIR /app
29
 
30
+ # Copy compiled binary
31
+ COPY --from=builder /app/engine/target/release/piston-api /usr/local/bin/piston
32
 
33
+ # Copy Runtimes.toml (optional; may not exist in new layout)
34
+ COPY --from=builder /app/engine/Runtimes.toml ./Runtimes.toml
35
 
36
+ # Set Piston's port to 7860
37
  ENV PORT=7860
38
  EXPOSE 7860
39
 
40
+ # Start the server
41
  CMD ["piston"]