codeskyblue / codeskyblue/gohttpserver
Need help with http basic auth
- Dominant language
- JavaScript
- Stars
- 2.8k
- Forks
- 583
- PR merge metrics
- No merged PRs in 30d
Description
Hi everyone, I need your help guys. I can not add http basic auth into my image.
I can start docker with command like into your example:
```
docker run -it --rm -p 8000:8000 -v $PWD:/app/public --name gohttpserver \
codeskyblue/gohttpserver \
--auth-type http --auth-http username:password
```
its work is good, but I cannot correctly added this command in my Dockerfile. I think that I have syntax mistake (I am not a good docker user), but I m not sure in it. Can you show me example for this if its posible?
My variant was:
```
FROM golang:1.10
WORKDIR /go/src/github.com/codeskyblue/gohttpserver
ADD . /go/src/github.com/codeskyblue/gohttpserver/
RUN go get -v
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-X main.VERSION=docker' -o gohttpserver
FROM debian:stretch
WORKDIR /app
RUN mkdir -p /app/public
RUN apt-get update && apt-get install -y ca-certificates
VOLUME /app/public
ADD assets ./assets
COPY --from=0 /go/src/github.com/codeskyblue/gohttpserver/gohttpserver .
EXPOSE 8000
ENTRYPOINT [ "/app/gohttpserver", "--root=/app/public" ]
CMD [ "--upload", "--delete", "--auth-type", "http", "--auth-http", "username:password" ]
```
But its not works.
Thanks for advance.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.