File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM node:14 AS development
2+
3+ ENV USERNAME timetracker
4+ ENV HOME /home/${USERNAME}
5+
6+ RUN useradd -ms /bin/bash ${USERNAME}
7+
8+ WORKDIR ${HOME}/time-tracker-ui
9+ COPY . .
10+ RUN rm -f .env
11+ RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui
12+
13+ USER ${USERNAME}
14+ RUN npm cache clean --force && npm install
15+ EXPOSE 4200
16+ EXPOSE 9876
17+ CMD npm run config && ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck
18+
19+
20+
21+ FROM development as build
22+ COPY .env .
23+ RUN npm run config && npm run build
24+
25+
26+
27+ FROM nginx:1.21 AS production
28+
29+ ENV USERNAME app
30+ RUN useradd -ms /bin/bash ${USERNAME}
31+
32+ COPY nginx.conf /etc/nginx/conf.d/default.conf
33+ COPY --from=build /home/timetracker/time-tracker-ui/dist/time-tracker /usr/share/nginx/html
34+
35+ RUN chown -R ${USERNAME}:${USERNAME} /var/cache/nginx && \
36+ chown -R ${USERNAME}:${USERNAME} /var/log/nginx && \
37+ chown -R ${USERNAME}:${USERNAME} /etc/nginx/conf.d
38+ RUN touch /var/run/nginx.pid && chown -R ${USERNAME}:${USERNAME} /var/run/nginx.pid
39+
40+ # USER ${USERNAME}
41+
42+ EXPOSE 80
You can’t perform that action at this time.
0 commit comments