forked from Alfresco/alfresco-ng2-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (31 loc) · 1.08 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
# 1. Generate licenses
FROM node:11.9-alpine AS builder
WORKDIR /usr/src/alfresco
COPY package.json package.json
RUN mkdir -p ./licenses && \
yarn licenses list > ./licenses/licenses.txt && \
yarn licenses generate-disclaimer > ./licenses/disclaimer.txt
# 2. Generate image
FROM nginx:stable-alpine
LABEL version="3.0.0"
ARG GROUPNAME=Alfresco
ARG GROUPID=1000
ARG USERNAME=adf
ARG USERID=33011
ARG BUILD_NUMBER
COPY ./docker/nginx.conf /etc/nginx/nginx.conf
COPY ./docker/entrypoint.sh /
WORKDIR /usr/share/nginx/html
COPY demo-shell/dist/ .
COPY --from=builder /usr/src/alfresco/licenses ./licenses
RUN addgroup -g ${GROUPID} ${GROUPNAME} && \
adduser -S -u ${USERID} -G ${GROUPNAME} -s "/bin/bash" ${USERNAME} && \
chown -R ${USERNAME}:${GROUPNAME} ./${BUILD_NUMBER}/app.config.json && \
chown -R ${USERNAME}:${GROUPNAME} /var/cache/nginx && \
touch /var/run/nginx.pid && \
chown -R ${USERNAME}:${GROUPNAME} /var/run/nginx.pid && \
chmod +x /entrypoint.sh && \
chown -R ${USERNAME}:${GROUPNAME} /entrypoint.sh
EXPOSE 8080
USER ${USERNAME}
ENTRYPOINT [ "/entrypoint.sh" ]