Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +9 -14
Dockerfile
CHANGED
|
@@ -1,26 +1,21 @@
|
|
| 1 |
-
# Gumamit ng Go base image para i-build ang Go program
|
| 2 |
FROM golang:1.21-alpine
|
| 3 |
|
| 4 |
-
# I-install ang git
|
| 5 |
RUN apk add --no-cache git
|
| 6 |
|
| 7 |
# I-set ang working directory
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
-
# I-clone ang repository
|
| 11 |
RUN git clone -b python https://github.com/EverythingSuckz/TG-FileStreamBot.git .
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
#
|
| 15 |
-
# pero base sa structure ng repo, malamang ganito ang magiging build step:
|
| 16 |
-
# Lumipat sa directory kung nasaan ang Go source code (malabong WebStreamer ang folder name, pero base sa CMD mo dati, subukan natin)
|
| 17 |
-
WORKDIR /app/WebStreamer
|
| 18 |
-
|
| 19 |
-
# Ngayon, i-download ang modules
|
| 20 |
RUN go mod download
|
| 21 |
|
| 22 |
-
# I-build ang
|
| 23 |
-
|
|
|
|
| 24 |
|
| 25 |
-
#
|
| 26 |
-
|
|
|
|
|
|
|
| 1 |
FROM golang:1.21-alpine
|
| 2 |
|
| 3 |
+
# I-install ang git
|
| 4 |
RUN apk add --no-cache git
|
| 5 |
|
| 6 |
# I-set ang working directory
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
+
# I-clone ang repository sa /app (dahil may dot '.' sa dulo)
|
| 10 |
RUN git clone -b python https://github.com/EverythingSuckz/TG-FileStreamBot.git .
|
| 11 |
|
| 12 |
+
# DAPAT AY NASA /app ANG go.mod file dahil sa pag-clone gamit ang '.'
|
| 13 |
+
# I-download ang modules sa /app directory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
RUN go mod download
|
| 15 |
|
| 16 |
+
# I-build ang Go program. Base sa iyong dating CMD, malamang ang main executable ay nasa loob ng WebStreamer folder.
|
| 17 |
+
# Kailangan mong i-build ang main package, na kadalasan ay nasa root o sa specific folder tulad ng "WebStreamer"
|
| 18 |
+
RUN go build -o WebStreamer ./WebStreamer/
|
| 19 |
|
| 20 |
+
# Final Command: Patakbuhin ang na-build na file (na nasa /app/WebStreamer)
|
| 21 |
+
CMD ["./WebStreamer/WebStreamer"]
|