spujadas / lighttpd-docker

Docker image for lighttpd, a secure, fast, compliant, and flexible web server
MIT License
59 stars 66 forks source link

Question about chmod #10

Closed jwillmer closed 5 years ago

jwillmer commented 5 years ago

Why do we need this in the script?

https://github.com/spujadas/lighttpd-docker/blob/f1bc14fa647d61f0994fb65efdb1ea3c68ef22d5/start.sh#L3

spujadas commented 5 years ago

It was introduced as part of #7 to log everything to the TTY, and IIRC the chmod a+w bit was due to /dev/pts/0 being only writable by root by default in some cases, so needed to make it universally writable for the ELK services to be able to dump their logs there.

jwillmer commented 5 years ago

O.K. I understand. My problem is that I used your configuration to create a container for my static files but it wont start. It always says:

chmod: /dev/pts/0: No such file or directory
2019-10-31 13:49:13: (server.c.748) opening errorlog '/dev/pts/0' failed: Permission denied
2019-10-31 13:49:13: (server.c.1518) Opening errorlog failed. Going down.

I call:

docker run -p 8080:80 registry.gitlab.com/company/image:latest

My Dockerfile

FROM alpine:3.10.3

ENV LIGHTTPD_VERSION=1.4.54-r0

# Install packages
RUN apk add --update --no-cache \
    lighttpd=${LIGHTTPD_VERSION} \
    lighttpd-mod_auth \
    curl \
  && rm -rf /var/cache/apk/*

COPY ./wwwroot/ /var/www/localhost/
COPY ./gitlab-ci/lighttpd/* /etc/lighttpd/
COPY ./gitlab-ci/start.sh /usr/local/bin/

# Check every minute if lighttpd responds within 1 second and update
# container health status accordingly.
HEALTHCHECK --interval=1m --timeout=1s \
  CMD curl -f http://localhost/ || exit 1

EXPOSE 80

VOLUME /etc/lighttpd
VOLUME /var/www/localhost

CMD ["start.sh"]
spujadas commented 5 years ago

8 should help you with this.

jwillmer commented 5 years ago

perfect, thx