-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
56 lines (43 loc) · 1.42 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# Nginx Dockerfile
#
# https://github.com/dockerfile/nginx
#
# Pull base image.
FROM nginx
# File Author / Maintainer
MAINTAINER Gonzalo Gasca Meza gonzalo@
# Install Nginx.
# Update the repository
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LC_CTYPE en_US.UTF-8
RUN echo "America/Los_Angeles" > /etc/timezone
RUN dpkg-reconfigure -f noninteractive tzdata
# Set hostname
RUN echo $(grep $(hostname) /etc/hosts | cut -f1) loadbalancer >> /etc/hosts
RUN apt-get update && apt upgrade
RUN locale-gen en_US en_US.UTF-8
# Install necessary tools
RUN apt-get install -y nano vim wget dialog net-tools
RUN apt install nginx-extras -y
# start script
ADD startup /usr/local/bin/startup
RUN chmod +x /usr/local/bin/startup
RUN mkdir /etc/nginx/ssl
# Copy a configuration file from the current directory
ADD nginx.conf /etc/nginx/
ADD nginx.key /etc/nginx/ssl/
ADD nginx.crt /etc/nginx/ssl/
# Define mountable directories.
VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx"]
# Expose ports.
EXPOSE 8443
CMD ["/usr/local/bin/startup"]