Skip to content

Instantly share code, notes, and snippets.

@hex-ci
Last active May 3, 2017 04:02
Show Gist options
  • Save hex-ci/58e54a1eb6550183a49905818dd9f35d to your computer and use it in GitHub Desktop.
Save hex-ci/58e54a1eb6550183a49905818dd9f35d to your computer and use it in GitHub Desktop.
My Dockerfile
FROM codeigniter/nginx-php-fpm:13
# set timezone
RUN apk add --no-cache tzdata \
&& mv /usr/share/zoneinfo/Asia/Shanghai /tmp/ \
&& rm -rf /usr/share/zoneinfo/* \
&& mkdir -p /usr/share/zoneinfo/Asia \
&& mv /tmp/Shanghai /usr/share/zoneinfo/Asia/ \
&& ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo Asia/Shanghai > /etc/timezone \
&& sed -i "s/date.timezone = UTC/date.timezone = Asia\/Shanghai/" /etc/php5/php.ini \
&& deluser nginx \
&& addgroup -g 1001 -S nginx \
&& adduser -u 1001 -D -H -h /var/lib/nginx/html -S -G nginx nginx \
&& rm -rf /usr/share/terminfo/* \
&& apk del --no-cache --purge apk-tools \
&& rm -rf /lib/apk
RUN chown nginx:nginx /var/lib/nginx \
&& chown nginx:nginx /var/lib/nginx/html \
&& chmod 775 /var/lib/nginx/html \
&& chown nginx:nginx /var/lib/nginx/tmp \
&& chmod 775 /var/lib/nginx/tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment