mirror of
https://github.com/arkorty/DownLink.git
synced 2026-03-18 00:57:15 +00:00
Initial commit
This commit is contained in:
42
backend/Dockerfile
Normal file
42
backend/Dockerfile
Normal file
@@ -0,0 +1,42 @@
|
||||
# Use the official Golang image
|
||||
FROM golang:1.20-alpine
|
||||
|
||||
# Set the Current Working Directory inside the container
|
||||
WORKDIR /server
|
||||
|
||||
# Copy go mod and sum files
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
|
||||
RUN go mod download
|
||||
|
||||
# Copy the source code into the container
|
||||
COPY . .
|
||||
|
||||
# Build the Go app
|
||||
RUN go build -o main .
|
||||
|
||||
RUN apk add --no-cache \
|
||||
python3 \
|
||||
python3-dev \
|
||||
py3-pip \
|
||||
build-base \
|
||||
git \
|
||||
wget \
|
||||
ffmpeg
|
||||
|
||||
# Create a virtual environment for Python
|
||||
RUN python3 -m venv /venv
|
||||
|
||||
# Activate the virtual environment and install yt-dlp
|
||||
RUN /venv/bin/pip install --upgrade pip && \
|
||||
/venv/bin/pip install yt-dlp
|
||||
|
||||
# Ensure ffmpeg is in the PATH
|
||||
ENV PATH="/usr/bin:/venv/bin:${PATH}"
|
||||
|
||||
# Expose port 8080 to the outside world
|
||||
EXPOSE 8080
|
||||
|
||||
# Command to run the executable
|
||||
CMD ["./main"]
|
||||
Reference in New Issue
Block a user