-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
104 lines (78 loc) · 1.88 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
FROM public.ecr.aws/lts/ubuntu:22.04
# Create: User
RUN useradd --create-home manager
# Working Directory
WORKDIR /usr/src/app
# Arguments
ARG DEBIAN_FRONTEND=noninteractive
ARG TARGETARCH
# Environment
ENV PYTHONUNBUFFERED=1
# --------
# Install: OS Dependencies
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
ca-certificates \
build-essential \
curl \
dh-autoreconf \
git \
ldap-utils \
less \
libldap2-dev \
libsasl2-dev \
libssl-dev \
libxmlsec1-dev \
nginx \
postgresql-client \
python3-dev \
python3-setuptools \
python3-pip \
python3-venv \
pkg-config \
rsync \
sudo \
tzdata \
uwsgi-emperor \
uwsgi-plugin-python3 \
unzip \
vim \
xmlsec1 \
&& rm -rf /var/lib/apt/lists/*
# --------
# Install: Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
# --------
# Setup: Timezone
ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# --------
# Nginx
COPY container/nginx/files/nginx.conf /etc/nginx/nginx.conf
RUN chown -R manager:manager /etc/nginx && \
chown -R manager:manager /var/lib/nginx && \
chown -R manager:manager /var/log/nginx
RUN touch /run/nginx.pid && \
chown -R manager:manager /run/nginx.pid
# --------
# Switch: User
USER manager
# --------
# Install: AWS Tools
COPY --chown=manager container/config/aws config/aws
RUN ./config/aws/cli/install.sh
# --------
# Copy: Configuration Files
COPY --chown=manager container/config config
# --------
# Install: Python Modules
RUN pip3 install -r config/python/requirements.txt --no-warn-script-location
# --------
# Copy: Application Files
COPY --chown=manager container .
# --------
# Run: Entrypoint
ENTRYPOINT ["/usr/src/app/docker/entrypoint.sh"]