-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
35 lines (33 loc) · 1.28 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 node:21 AS build
WORKDIR /usr/src
COPY start-client/package.json ./
COPY start-client/yarn.lock ./
COPY start-client/setupJest.js ./
COPY start-client/.babelrc ./
COPY start-client/src/ ./src/
COPY start-client/dev/ ./dev/
COPY start-client/static/ ./static/
COPY start-client/webpack.common.js ./
COPY start-client/webpack.prod.js ./
COPY start-client/webpack.dev.js ./
COPY start-client/BuildVersion.json ./
RUN yarn install
ENV GOOGLE_TAGMANAGER_ID="G-2778ZJCYZ4"
RUN yarn build
FROM phusion/passenger-nodejs:3.0.1
COPY --from=build /usr/src /usr/share/initializr/www
RUN chown -R app:app /usr/share/initializr/www
RUN apt-get update && apt-get install -y gettext-base
RUN rm /etc/nginx/sites-enabled/default
RUN rm -f /etc/service/nginx/down
RUN sed -i "s|daemon off;|#daemon off; |g" /etc/nginx/nginx.conf
RUN echo "env INITIALIZR_SERVICE_HOST;" >> /etc/nginx/main.d/default.conf
RUN echo "env INITIALIZR_SERVICE_URI;" >> /etc/nginx/main.d/default.conf
COPY deploy/docker/initializr-web.conf.template /etc/nginx/templates/
COPY deploy/docker/docker-entrypoint.sh ./
RUN chmod +x ./docker-entrypoint.sh
ENTRYPOINT [ "./docker-entrypoint.sh" ]
CMD ["nginx", "-g", "daemon off;"]
# cat /etc/nginx/sites-enabled/initializr.conf
# tail -f /var/log/nginx/access.log
# tail -f /var/log/nginx/error.log