No styling on Docker container. #5604

Closed
opened 2025-11-02 06:30:34 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @leggettc18 on GitHub (Jun 22, 2020).

  • Gitea version (or commit ref): latest tag of docker container
  • Git version:
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I deployed the docker container with a Caddy reverse proxy and when I navigate to it I get what appears to be the home page with no styling. Checking the network tab of my devtools shows what appears to be a bunch of redirects to the install page, but it appears to attempt the redirect several times, resulting in urls like this getting logged:

https://git.leggett.dev/git.leggett.dev/img/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/install

Caddyfile

git.{$MY_DOMAIN} {
    reverse_proxy gitea:3000
}

Docker Compose

version: "3"

services:
    gitea:
        image: gitea/gitea:latest
        container_name: gitea
        hostname: gitea
        env_file: .env
        restart: unless-stopped
        volumes:
            - ./gitea-data:/data
            - /etc/timezone:/etc/timezone:ro
            - /etc/localtime:/etc/localtime:ro
        ports:
            - "222:22"
        depends_on:
            - gitea-db
    gitea-db:
        image: mysql:5.7
        container_name: gitea-db
        hostname: gitea-db
        restart: unless-stopped
        env_file: .env
        volumes:
            - ./gitea-db-data:/var/lib/mysql
networks:
    default:
        external: 
            name: $DOCKER_MY_NETWORK

.env

# GENERAL
MY_DOMAIN=leggett.dev
DOCKER_MY_NETWORK=caddy_net
TZ=America/New_York

# GITEA
USER_UID=1000
USER_GID=1000
DB_TYPE=mysql
DB_HOST=gitea-db:3306
DB_NAME=gitea
DB_USER=gitea
DB_PASSWD=gitea
RUN_MODE=prod

# MYSQL
MYSQL_ROOT_PASSWORD=gitea
MYSQL_USER=gitea
MYSQL_PASSWORD=gitea
MYSQL_DATABASE=gitea

...

Screenshots

Originally created by @leggettc18 on GitHub (Jun 22, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): latest tag of docker container - Git version: - Operating system: - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description I deployed the docker container with a Caddy reverse proxy and when I navigate to it I get what appears to be the home page with no styling. Checking the network tab of my devtools shows what appears to be a bunch of redirects to the install page, but it appears to attempt the redirect several times, resulting in urls like this getting logged: ``` https://git.leggett.dev/git.leggett.dev/img/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/git.leggett.dev/install ``` Caddyfile ``` git.{$MY_DOMAIN} { reverse_proxy gitea:3000 } ``` Docker Compose ``` version: "3" services: gitea: image: gitea/gitea:latest container_name: gitea hostname: gitea env_file: .env restart: unless-stopped volumes: - ./gitea-data:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "222:22" depends_on: - gitea-db gitea-db: image: mysql:5.7 container_name: gitea-db hostname: gitea-db restart: unless-stopped env_file: .env volumes: - ./gitea-db-data:/var/lib/mysql networks: default: external: name: $DOCKER_MY_NETWORK ``` .env ``` # GENERAL MY_DOMAIN=leggett.dev DOCKER_MY_NETWORK=caddy_net TZ=America/New_York # GITEA USER_UID=1000 USER_GID=1000 DB_TYPE=mysql DB_HOST=gitea-db:3306 DB_NAME=gitea DB_USER=gitea DB_PASSWD=gitea RUN_MODE=prod # MYSQL MYSQL_ROOT_PASSWORD=gitea MYSQL_USER=gitea MYSQL_PASSWORD=gitea MYSQL_DATABASE=gitea ``` ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the issue/stale label 2025-11-02 06:30:34 -06:00
Author
Owner

@leggettc18 commented on GitHub (Jun 22, 2020):

So I ended up deleting the gitea-data directory, re-creating the container, and that fixed it, I think the issue may have had something to do with having the DOMAIN, SSH_DOMAIN and ROOT_URL being set the first time, possibly incorrectly, causing the issue. Leaving them unset has at least set the styling issues back to normal, although since it is running in a docker container I may have to experiment further with those.

@leggettc18 commented on GitHub (Jun 22, 2020): So I ended up deleting the gitea-data directory, re-creating the container, and that fixed it, I think the issue may have had something to do with having the `DOMAIN`, `SSH_DOMAIN` and `ROOT_URL` being set the first time, possibly incorrectly, causing the issue. Leaving them unset has at least set the styling issues back to normal, although since it is running in a docker container I may have to experiment further with those.
Author
Owner

@stale[bot] commented on GitHub (Aug 23, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Aug 23, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Sep 6, 2020):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Sep 6, 2020): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5604