-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
35 lines (24 loc) · 1.14 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
FROM registry.access.redhat.com/ubi8/nginx-118
USER root
# Install dos2unix utility
RUN yum install -y dos2unix
# Configure certificate and key
RUN mkdir -p /etc/pki/nginx/private && \
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/pki/nginx/private/server.key -out /etc/pki/nginx/server.crt --batch && \
chown -R 1001:0 /etc/pki/nginx/ && chmod 755 /etc/pki/nginx/private/server.key /etc/pki/nginx/server.crt
# Grant write permission to group
RUN chmod -R g+w /opt/app-root/src /usr/local/bin/
# Copy configuration scripts
COPY --chown=1001:0 build/configs/configure-keycloak.sh /usr/local/bin/configure-keycloak.sh
COPY --chown=1001:0 build/configs/entrypoint.sh /usr/local/bin/entrypoint.sh
# Copy nginx config
COPY --chown=1001:0 build/configs/nginx.conf /etc/nginx/nginx.conf
# To avoid build failure in windows, convert text files from DOS line
# endings (carriage return + line feed) to Unix line endings (line feed).
RUN dos2unix /usr/local/bin/configure-keycloak.sh
# Copy dist files
COPY --chown=1001:0 dist/ .
# Expose port 8080 for http and 1337 for https
EXPOSE 8080 1337
USER 1001
CMD /usr/local/bin/entrypoint.sh