Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM golang:1.16 as builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -o apollo ./cmd/

FROM alpine

# Taken from https://github.com/wernight/docker-youtube-dl
RUN apk add --no-cache ca-certificates curl dumb-init ffmpeg gnupg python3 libc6-compat
RUN curl -Lo /usr/local/bin/youtube-dl https://yt-dl.org/downloads/latest/youtube-dl && \
curl -Lo youtube-dl.sig https://yt-dl.org/downloads/latest/youtube-dl.sig && \
gpg --keyserver keyserver.ubuntu.com --recv-keys '7D33D762FD6C35130481347FDB4B54CBA4826A18' && \
gpg --keyserver keyserver.ubuntu.com --recv-keys 'ED7F5BF46B3BBED81C87368E2C393E0F18A9236D' && \
gpg --verify youtube-dl.sig /usr/local/bin/youtube-dl && \
chmod a+rx /usr/local/bin/youtube-dl && \
ln -s /usr/bin/python3 /usr/bin/python && \
rm youtube-dl.sig && \
apk del curl gnupg
WORKDIR /etc/apollo
RUN mkdir data
COPY --from=builder /src/apollo /bin/apollo
COPY --from=builder /src/static/ ./static/
EXPOSE 8993
ENTRYPOINT ["/bin/apollo"]
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3.6'

services:
app:
build: .
environment:
PASSWORD: my_password
ports:
- 8993:8993
3 changes: 1 addition & 2 deletions pkg/apollo/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ func authenticatePassword(w http.ResponseWriter, r *http.Request) {
}

func isValidPassword(password string) bool {
err := godotenv.Load()
check(err)
godotenv.Load()
truePass := os.Getenv("PASSWORD")
return truePass == password
}
Expand Down