33 lines
		
	
	
	
		
			839 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			839 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
# TODO(any)(latest)
 | 
						|
FROM alpine:latest
 | 
						|
 | 
						|
EXPOSE 443
 | 
						|
 | 
						|
# install curl
 | 
						|
RUN apk update
 | 
						|
RUN apk add curl
 | 
						|
RUN apk fix
 | 
						|
 | 
						|
# install nginx
 | 
						|
# TODO(any) installed automatically?
 | 
						|
#RUN apk add openssl curl ca-certificates
 | 
						|
RUN printf "%s%s%s%s\n" \
 | 
						|
    "@nginx " \
 | 
						|
    "http://nginx.org/packages/alpine/v" \
 | 
						|
    `egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release` \
 | 
						|
    "/main" \
 | 
						|
    | tee -a /etc/apk/repositories
 | 
						|
RUN curl -o /tmp/nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub
 | 
						|
RUN mv /tmp/nginx_signing.rsa.pub /etc/apk/keys/
 | 
						|
RUN apk update
 | 
						|
RUN apk add nginx@nginx mysql-client
 | 
						|
RUN apk fix
 | 
						|
 | 
						|
# add config
 | 
						|
RUN rm /etc/nginx/nginx.conf
 | 
						|
COPY conf/ /etc/nginx/
 | 
						|
 | 
						|
# start
 | 
						|
CMD ["nginx", "-g", "daemon off;"]
 | 
						|
 | 
						|
HEALTHCHECK --interval=1s --timeout=10s --start-period=60s --retries=1 CMD [ "sh", "-c", "! [ -z \"$(netstat -tuln | grep :443)\" ]" ]
 |