Public Repository

Last pushed: 5 months ago
Short Description
Nginx image for Raspberry Pi (based on Alpine Linux)
Full Description

Dockerfile

Based on xaviaznar/rpi-alpine-base

FROM  rpi-alpine-base:20170325

RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
    apk add --update nginx && \
    rm -rf /var/cache/apk/*

COPY nginx.conf /etc/nginx/nginx.conf
COPY site-default.conf /etc/nginx/conf.d/default.conf
COPY index.html /var/www/index.html

VOLUME ["/var/www", "/var/log/nginx/"]

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]

nginx.conf

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

site-default.conf

server {
    listen       80;
    server_name  localhost;

    location / {
        root   /var/www;
        index  index.html index.htm;
    }

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

index.html

<!doctype html>
<html>
<head><title>Welcome to Nginx on Docker</t1></head>
<body><center>
<h1>Welcome to Nginx on Docker</h1>
</center></body>
</html>
Docker Pull Command
Owner
xaviaznar

Comments (0)