-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.erb
More file actions
69 lines (56 loc) · 1.68 KB
/
Copy pathDockerfile.erb
File metadata and controls
69 lines (56 loc) · 1.68 KB
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
FROM tomcat:<%= image.version %>
<%= snippet('labels', binding) -%>
WORKDIR /
<%= snippet('docker-entrypoint', binding) -%>
## run.sh below requires complex test expressions "[[" vs "["
RUN sed -i 's,^#!/bin/sh,#!/bin/bash,' /docker-entrypoint.sh
<%= snippet('dockerize', binding) -%>
<%= snippet('tini', binding) -%>
## Common Environment Variables
ENV DEBUG=0
ENV TZ=America/Vancouver
## Deployment Environment Variables
ENV CATALINA_BASE="/app/tomcat"
ENV CONNECT_TIMEOUT=5
ENV PROXY=""
ENV RUN_DOCKERIZE=0
ENV RUN_POSTDEPLOYMENT=0
ENV RUN_VANILLA=0
ENV S3_URL=""
ENV S3_AK=""
ENV S3_SK=""
ENV SKIP_CHECKSUM=0
## Update, Install, Cleanup
RUN set -eux \
&& echo 'APT::Install-Suggests "0";' >> /etc/apt/apt.conf.d/00-docker \
&& echo 'APT::Install-Recommends "0";' >> /etc/apt/apt.conf.d/00-docker \
## UPDATE
&& DEBIAN_FRONTEND=noninteractive apt-get update \
## INSTALL: packages
&& apt-get install -y --no-install-recommends \
## here goes a list of packages to install
file \
unzip \
## CLEANUP
&& apt-get autoremove -yqq --purge \
## here goes a list of packages to purge
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
## Scripts for Configuration and WAR data processing
COPY ../resources/scripts/run.d/*.sh /run.d/
## Main script
COPY ../resources/scripts/run.sh /docker-entrypoint.d/
## App directory, scripts, and permissions
RUN mkdir -p /app \
&& chmod 0777 /app \
&& chown 0:0 /app \
&& chmod 0755 /run.d \
&& chown 0:0 /run.d \
&& chmod 0444 /run.d/*.sh \
&& chown 0:0 /run.d/*.sh
## Set working directory
WORKDIR /app
## Set entrypoint for scripts
ENTRYPOINT ["/tini", "--", "/docker-entrypoint.sh"]
## Run Tomcat Catalina
CMD [ "catalina.sh", "run" ]