'How to serve HTTPS for React app in Docker environment without docker compose?
I am currently running website for 80 port in HTTP with only one Dockerfile which runs both my React application and nginx server and generates the react build and copies it to nginx server. I tried to find the way for applying cerbot for nginx to make HTTPS website, all the ways are in docker compose. And in some servers it is not the best practice. I want to do it in one Dockerfile without adding any docker compose file. Is it possible to apply certbot along with Nginx and serve React app in HTTPS. Here is my Dockerfile running for HTTP:
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm install
# Build
COPY . .
RUN npm run build
FROM fitiavana07/nginx-react
COPY --from=build-stage /app/build /usr/share/nginx/html
EXPOSE 80
EXPOSE 443
CMD nginx -g 'daemon off;'
Or is there any other way of deploying the React application with Docker in HTTPS.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
