Need help with serving the bundled script of React.js

1. Bundled script and css of React.js files keeps loading, script that resides inside the head tag of html file. Below is the setup.

// Stage 1: Build React application

// Stage 2: Serve React application with Caddy
FROM caddy:latest
COPY --from=build /app/frontend/dist /srv

version: "3.9"
      context: ./frontend
      dockerfile: Dockerfile
    restart: always
    image: caddy
      - "80:80"
      - "443:443"
      - ./frontend/caddy/Caddyfile:/etc/caddy/Caddyfile
    servers {
        timeouts {
                read_body   2m
                read_header 2m
                write       2m
                idle        5m
} {

    handle /api/* {
        reverse_proxy backendapi:3000 {
            transport http {
                read_timeout 1m
                write_timeout 1m

    # react app
    handle /* {
        root * /srv
        try_files {path} /index.html

3. Caddy version:

Caddy version v2.6.4

a. System environment:

Os- Linux

Please completely fill out the help topic template, as per the forum rules. DO NOT remove any sections. You haven’t explained what isn’t working. Show logs, show an example request with curl -v.

Also, please review the docs for our recommendations for Docker compose, there’s problems in your config Keep Caddy Running — Caddy Documentation

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.