This repository was archived by the owner on Jul 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
69 lines (61 loc) · 2.19 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
#
# Build com o zip
#
FROM alpine:3.8 AS base
WORKDIR /
ENV MASTER="https://softwarepublico.gov.br/gitlab/agatha/agatha/repository/archive.zip?ref=master"
RUN apk add --update --no-cache unzip curl && \
curl $MASTER --output archive.zip && \
unzip archive.zip
#
# Build do frontend (Angular)
#
FROM node:6-alpine AS frontend
WORKDIR /
COPY --from=base /agatha.git /agatha.git
RUN apk add --update --no-cache make gcc g++ python git && \
cd /agatha.git/codigo-fonte/cliente/ \
&& mkdir bower_components && \
npm install && \
npm install -g bower && bower install --allow-root && \
npm run build
#
# Build do backend (Java)
#
FROM maven:3-jdk-8-alpine AS backend
WORKDIR /
COPY --from=base /agatha.git /agatha.git
RUN cd /agatha.git/codigo-fonte/servico/ && \
mvn -Dmaven.test.failure.ignore -U clean package && ls -lah
#
# Build Final
#
FROM openjdk:8-jdk-alpine
LABEL maintainer="Lucas G. Diedrich <[email protected]>"
WORKDIR /
ENV JAVA_OPTS="-server -Xmx2G -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70" \
CONF_CHECK="1" \
DB_CHECK="1" \
DB_HOST="agathadb" \
DB_NAME="agatha" \
DB_USER="gestaoriscos" \
DB_PASSWORD="gestaoriscos" \
ECIDADAO_ENV="PROD" \
ECIDADAO_SERVER="MINHAINSTITUICAO.EDU.BR" \
ECIDADAO_ID="MINHAID" \
ECIDADAO_SECRET="MINHAKEY" \
SIORG="2981"
COPY --from=frontend /agatha.git/codigo-fonte/cliente/dist/ /usr/share/nginx/html/
COPY --from=backend /agatha.git/codigo-fonte/servico/target/app.jar /app.jar
COPY files/ /
RUN apk add --update --no-cache openssl bash nginx supervisor postgresql-client \
msttcorefonts-installer fontconfig && \
mkdir -p /etc/nginx/certificates/ /run/nginx/ /run/supervisord/ && \
openssl req -x509 -nodes -newkey rsa:4096 -keyout /etc/nginx/certificates/key.pem -out /etc/nginx/certificates/cert.pem -subj '/CN=localhost' -days 365 && \
chmod +x /usr/bin/pre-init /usr/bin/create-admin && \
rm -rf /var/cache/apk/* && \
update-ms-fonts && \
fc-cache -f
VOLUME ["/config"]
EXPOSE 80 443
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]