Skip to content

Thoughts about Gitea Pages #19129

@bvn13

Description

@bvn13

Feature Description

I've seen #302

Let me describe my workaround of it.

My gitea in docker:

$ cat docker-compose.yaml 
version: "3.7"

networks:
  gitea:
    external: true

services:
  gitea:
    image: gitea/gitea:1.16.4
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - GITEA__database__DB_TYPE=postgres
      - GITEA__database__HOST=db:5432
      - GITEA__database__NAME=gitea
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD=gitea
    restart: always
    networks:
      - gitea
    volumes:
      - ./gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "8080:3000"
      - "2221:22"
    expose:
      - 3000
    depends_on:
      - db
  db:
     image: postgres:13
     restart: always
     environment:
       - POSTGRES_USER=gitea
       - POSTGRES_PASSWORD=gitea
       - POSTGRES_DB=gitea
     networks:
       - gitea
     volumes:
       - ./postgres:/var/lib/postgresql/data

$ cat rebuild.sh 
#!/bin/bash
docker-compose down
docker-compose up -d --no-deps --build
docker-compose logs gitea

My "pages" docker:

$ cat docker-compose.yaml 
version: '3.7'

networks:
  bvn13me:
    external: true

services:

  nginx:
    build:
      context: .
    image: "bvn13me"
    container_name: bvn13me
    networks:
      - bvn13me
    ports:
      - "8081:8080"

$ cat Dockerfile 
FROM python:3.9

# Install python3
RUN apt-get update
RUN apt-get install -y python3
RUN apt-get install -y git

# Invalidate cache
ARG CACHEBUST=1

# Copy html
RUN git clone http://gitea.bvn13.me/bvn13/bvn13-me.git /app
RUN ls -la /
RUN ls -la /app
RUN ls -la /app/src
WORKDIR /app/src

# Run http server on port 8080
EXPOSE  8080
CMD ["python3", "-m", "http.server", "8080"]

$ cat rebuild.sh 
#!/bin/bash
docker-compose down
docker-compose build --no-cache --build-arg CACHEBUST=$(date +%s) # cache cleaning does not work yet
docker-compose up -d --no-deps --no-build

I should mention my gitea and my "pages" are mapped to gitea.bvn13.me with nginx.
My workaround is to run last rebuild.sh in order to update my "pages".

So... will it be helpful for solving that issue?

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions