Skip to content

Commit

Permalink
Fix WORK_DIR for docker (root) image (#25738)
Browse files Browse the repository at this point in the history
Fix #25726 

#17846 chose an incorrect WORK_DIR path for docker root image.

Gitea's work-path was already used as the base path for various paths
(like AppDataPath), so, the work-path should be mounted to a volume in a
docker image.

Now, for docker root image, it's unavoidable to mix the
WorkPath/CustomPath/AppDataPath in the same directory ("/data/gitea"),
because some of them have already been mixed.

Some directories in the screenshot are for "CustomPath" , while others
are for "AppDataPath", due to the technical debts in old code:

```
CUSTOM_PATH="/data/gitea"
APP_DATA_PATH = /data/gitea
```

<details>


![image](https://github.com/go-gitea/gitea/assets/2114189/9f0648ac-f731-4a08-9f26-1af01a1824b1)

</details>


This PR is breaking but this is the only way at the moment to avoid
users losing their data accidently

Co-authored-by: Giteabot <teabot@gitea.io>
  • Loading branch information
wxiaoguang and GiteaBot authored Jul 10, 2023
1 parent d987279 commit 5489962
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker/root/usr/local/bin/gitea
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
# And place the original in /usr/lib/gitea with working files in /data/gitea
GITEA="/app/gitea/gitea"
WORK_DIR="/app/gitea"
WORK_DIR="/data/gitea"
CUSTOM_PATH="/data/gitea"

# Provide docker defaults
Expand Down

0 comments on commit 5489962

Please sign in to comment.