diff --git a/docker-compose.yml b/docker-compose.yml index fcc48f5..15b9282 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -112,7 +112,7 @@ services: # You also have to change the flower command flower: - image: mher/flower + image: mher/flower:0.9.7 networks: - ${TRAEFIK_PUBLIC_NETWORK?Variable not set} - default diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 75157e0..445c4b3 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,14 +1,23 @@ # Stage 0, "build-stage", based on Node.js, to build and compile the frontend -FROM tiangolo/node-frontend:10 as build-stage +FROM node:16 as build-stage-1 + +# I dont know, it this installation required for you, you might delete them +RUN apt-get update && apt-get install -y wget --no-install-recommends \ + && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ + && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ + && apt-get update \ + && apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* \ + && apt-get purge --auto-remove -y curl \ + && rm -rf /src/*.deb WORKDIR /app -COPY package*.json /app/ +COPY ./ /app/ RUN npm install -COPY ./ /app/ - ARG FRONTEND_ENV=production ENV VUE_APP_ENV=${FRONTEND_ENV} @@ -18,11 +27,9 @@ RUN npm run test:unit RUN npm run build - # Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx FROM nginx:1.15 -COPY --from=build-stage /app/dist/ /usr/share/nginx/html - -COPY --from=build-stage /nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=build-stage-1 /app/dist/ /usr/share/nginx/html +COPY ./nginx.conf /etc/nginx/conf.d/default.conf COPY ./nginx-backend-not-found.conf /etc/nginx/extra-conf.d/backend-not-found.conf diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..ed11d3a --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,11 @@ +server { + listen 80; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html =404; + } + + include /etc/nginx/extra-conf.d/*.conf; +}