Files
workavia-drive/twake/docker/tdrive-frontend/Dockerfile
T
Anton Shepilov 380f01222a 🐳 Deploy image to the internal docker registry
* Deploy the image to the internal docker registry
* Removed unnecessary stage in backend build
2023-04-05 15:55:29 +02:00

32 lines
1.1 KiB
Docker
Executable File

# First stage: building frontend
FROM node:lts AS build
RUN yarn global add webpack webpack-cli
COPY frontend /twake-react/
WORKDIR /twake-react/
ENV GENERATE_SOURCEMAP=false
RUN cp /twake-react/src/app/environment/environment.ts.dist /twake-react/src/app/environment/environment.ts && \
yarn install --network-timeout 1000000000 && \
# cat /twake-react/src/app/environment/environment.ts.dist && \
# cat /twake-react/src/app/environment/environment.ts && \
yarn build && \
rm -rf node_modules
# Second stage: configuring nginx and copying build artifacts
FROM nginx:latest
COPY docker/tdrive-frontend/nginx.conf /etc/nginx/nginx.conf
COPY docker/tdrive-frontend/site.conf /etc/nginx/sites-available/site.template
COPY docker/tdrive-frontend/redirect.conf /etc/nginx/sites-available/redirect
COPY docker/tdrive-frontend/entrypoint.sh /
COPY docker/tdrive-frontend/self-signed.sh /usr/local/bin/
COPY --from=build /twake-react /twake-react
RUN chmod +x /entrypoint.sh && rm /etc/nginx/conf.d/default.conf
ENTRYPOINT ["/entrypoint.sh", "$DEV"]
EXPOSE 80
EXPOSE 443