no1b4me commited on
Commit
8cdbdad
·
verified ·
1 Parent(s): 8cef93b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -12
Dockerfile CHANGED
@@ -1,14 +1,13 @@
1
  # Stage 1: Build the application
2
  FROM golang:1.22 AS builder
3
 
4
- # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
- # Copy go.mod and go.sum to download dependencies
8
  COPY go.mod go.sum ./
9
  RUN go mod download
10
 
11
- # Copy the rest of the application code
12
  COPY . .
13
 
14
  # Build the application binary
@@ -17,23 +16,19 @@ RUN go build -o go_jackett main.go
17
  # Stage 2: Create a minimal runtime container
18
  FROM debian:bullseye-slim
19
 
20
- # Set the working directory
21
  WORKDIR /app
22
 
23
- # Install essential packages (for running the app)
24
  RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
25
 
26
- # Copy the binary and required directories from the builder stage
27
  COPY --from=builder /app/go_jackett /app/
28
- COPY --from=builder /app/.env /app/
29
- COPY --from=builder /app/persistence /app/persistence
30
- COPY --from=builder /app/temp /app/temp
31
 
32
- # Set the default environment variable (optional, can be overridden)
33
- ENV PORT=3000
34
 
35
  # Expose the application port
36
  EXPOSE 3000
37
 
38
- # Start the application
39
  CMD ["./go_jackett"]
 
1
  # Stage 1: Build the application
2
  FROM golang:1.22 AS builder
3
 
 
4
  WORKDIR /app
5
 
6
+ # Copy go.mod and go.sum and download dependencies
7
  COPY go.mod go.sum ./
8
  RUN go mod download
9
 
10
+ # Copy application code
11
  COPY . .
12
 
13
  # Build the application binary
 
16
  # Stage 2: Create a minimal runtime container
17
  FROM debian:bullseye-slim
18
 
 
19
  WORKDIR /app
20
 
21
+ # Install necessary runtime dependencies
22
  RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
23
 
24
+ # Copy the built binary from the builder stage
25
  COPY --from=builder /app/go_jackett /app/
 
 
 
26
 
27
+ # Copy the .env file for configuration (if needed)
28
+ COPY .env /app/.env
29
 
30
  # Expose the application port
31
  EXPOSE 3000
32
 
33
+ # Default command to run the application
34
  CMD ["./go_jackett"]