forked from johnsusek/praeco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (33 loc) · 1009 Bytes
/
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
FROM node:lts AS base
ARG LABEL_COMMIT=unknown
ARG LABEL_COMMIT_LINK=unknown
ARG LABEL_COMMIT_BRANCH=unknown
ARG LABEL_REPO=unkown
ARG LABEL_REPO_LINK=unknown
ARG LABEL_PROJECT_NAME=unknown
ARG LABEL_BUILD_CREATED=unknown
LABEL "commit"="${LABEL_COMMIT}" \
"commit_link"="${LABEL_COMMIT_LINK}" \
"commit_branch"="${LABEL_COMMIT_BRANCH}" \
"repo"="${LABEL_REPO}" \
"repo_link"="${LABEL_REPO_LINK}" \
"project_name"="${LABEL_PROJECT_NAME}" \
"build_created"="${LABEL_BUILD_CREATED}" \
"maintainer"="ServerCentral"
RUN apt-get update
RUN apt-get install -y nginx
RUN mkdir -p /tmp/nginx/praeco
RUN mkdir -p /var/log/nginx
RUN mkdir -p /var/www/html
RUN chown www-data:www-data /var/www/html
WORKDIR /tmp/nginx/praeco
COPY package.json .
FROM base AS dependencies
RUN npm install --loglevel error
FROM base AS release
COPY --from=dependencies /tmp/nginx/praeco/node_modules ./node_modules
COPY . .
RUN npm run build
RUN cp -r dist/* /var/www/html
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]