Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker improvements #283

Merged
merged 4 commits into from
May 30, 2021
Merged
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
.editorconfig
.git*
*.md
docker/
Copy link
Member

@kleisauke kleisauke May 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh curious, wasn't this covered by the "Ignore all subdirectories"-statement (*/*) above? I'll have a look.

17 changes: 9 additions & 8 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ RUN dnf install -y dnf-utils \
&& sed -i '/^exclude=/ s/$/,libjpeg-turbo-*.*.9[0-9]-*/' /etc/yum.repos.d/libjpeg-turbo.repo \
&& dnf install -y libjpeg-turbo-official \
&& echo '/opt/libjpeg-turbo/lib64' >> /etc/ld.so.conf.d/libjpeg-turbo-official-x86_64.conf \
&& ldconfig
&& ldconfig \
&& dnf clean all

# Update the PKG_CONFIG_PATH environment variable,
# since libjpeg-turbo is installed in a non-standard prefix
Expand All @@ -44,7 +45,8 @@ RUN dnf install -y epel-release \
gcc-c++ \
openssl-devel \
pcre-devel \
zlib-devel
zlib-devel \
&& dnf clean all

# Create nginx user and group
RUN groupadd nginx \
Expand Down Expand Up @@ -76,17 +78,16 @@ RUN cmake3 .. \
--lock-path=/run/lock/subsys/nginx;\
--user=nginx;\
--group=nginx" \
&& make -j$(nproc) \
&& make -j"$(nproc)" \
&& ldconfig

WORKDIR /var/www/imagesweserv

# Ensure nginx directories exist
RUN mkdir -p -m 700 /var/lib/nginx \
&& mkdir -p -m 700 /var/lib/nginx/tmp \
&& mkdir -p -m 700 /var/log/nginx \
&& mkdir -p -m 755 /usr/share/nginx/html \
&& mkdir -p -m 755 /usr/lib64/nginx/modules \
RUN mkdir -m 700 /var/lib/nginx \
&& mkdir -m 700 /var/lib/nginx/tmp \
&& mkdir -m 700 /usr/lib64/nginx \
&& mkdir -m 755 /usr/lib64/nginx/modules \
# Forward request and error logs to docker log collector
&& ln -sf /dev/stdout /var/log/nginx/weserv-access.log \
&& ln -sf /dev/stderr /var/log/nginx/weserv-error.log \
Expand Down