abcd118q commited on
Commit
1e50e50
·
verified ·
1 Parent(s): 97cae39

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -16
Dockerfile CHANGED
@@ -7,34 +7,34 @@ ENTRYPOINT []
7
  ENV ONEDEV_HTTP_PORT=7860
8
  ENV ONEDEV_SSH_PORT=7861
9
 
10
- # 3. We need root to move files around at boot
11
  USER root
12
  WORKDIR /app
13
 
14
  EXPOSE 7860
15
 
16
- # 4. THE INDESTRUCTIBLE STARTUP SCRIPT:
17
- # - Checks if /data is empty.
18
- # - If empty, copies the default config from the image into /data.
19
- # - Fixes permissions.
20
- # - Executes the server.
21
  CMD ["/bin/sh", "-c", " \
22
  echo '--- 2027 OneDev persistent Boot ---'; \
23
  \
24
- # 1. Check if the config exists in the persistent volume
25
  if [ ! -f /data/conf/server.properties ]; then \
26
- echo 'First run detected. Seeding /data with default configuration...'; \
27
- cp -rn /app/site/* /data/; \
28
- else \
29
- echo 'Existing data found in /data. Skipping seed.'; \
30
  fi; \
31
  \
32
- # 2. Fix permissions for the JVM
 
 
 
 
33
  chmod -R 777 /data; \
34
  \
35
- # 3. Wipe the local site folder and link it to our persistent /data
36
- rm -rf /app/site; \
37
- ln -s /data /app/site; \
38
  \
39
- echo 'Launching OneDev on port 7860...'; \
40
  exec /app/bin/server.sh console"]
 
7
  ENV ONEDEV_HTTP_PORT=7860
8
  ENV ONEDEV_SSH_PORT=7861
9
 
10
+ # 3. Use root for the setup phase
11
  USER root
12
  WORKDIR /app
13
 
14
  EXPOSE 7860
15
 
16
+ # 4. THE SPEED-BOOT SCRIPT:
17
+ # - Seeds data if missing
18
+ # - FORCES the config file to use port 7860 (Fixes the Timeout)
19
+ # - Launches the JVM
 
20
  CMD ["/bin/sh", "-c", " \
21
  echo '--- 2027 OneDev persistent Boot ---'; \
22
  \
23
+ # 1. Seed data if the volume is empty \
24
  if [ ! -f /data/conf/server.properties ]; then \
25
+ echo 'Seeding /data...'; \
26
+ cp -r /app/site/* /data/; \
 
 
27
  fi; \
28
  \
29
+ # 2. CRITICAL: Force port 7860 into the actual config file \
30
+ # This ensures OneDev listens where HF is looking \
31
+ sed -i 's/http_port.*/http_port=7860/g' /data/conf/server.properties; \
32
+ \
33
+ # 3. Fix permissions \
34
  chmod -R 777 /data; \
35
  \
36
+ # 4. Link persistence \
37
+ rm -rf /app/site && ln -s /data /app/site; \
 
38
  \
39
+ echo 'Launching OneDev... (Wait 2-3 mins for the UI to appear)'; \
40
  exec /app/bin/server.sh console"]