README.md
@@ -3,8 +3,10 @@ https://gethomepage.dev/ | |||
3 | 3 | Get Code-server here: | |
4 | 4 | https://github.com/coder/code-server | |
5 | 5 | ||
6 | + | Can also be cloned: | |
7 | + | git clone https://git.lolwith.me/sysadmin/homepage-code-server /your-folder | |
6 | 8 | ||
7 | - | ||
9 | + | #================= | |
8 | 10 | Generic folder structure for docker: | |
9 | 11 | ||
10 | 12 | /home/sysadmin/dock |
README.md
@@ -1,3 +1,10 @@ | |||
1 | + | Get Homepage here: | |
2 | + | https://gethomepage.dev/ | |
3 | + | Get Code-server here: | |
4 | + | https://github.com/coder/code-server | |
5 | + | ||
6 | + | ||
7 | + | ||
1 | 8 | Generic folder structure for docker: | |
2 | 9 | ||
3 | 10 | /home/sysadmin/dock |
.env(文件已创建)
@@ -0,0 +1,8 @@ | |||
1 | + | PUID=1000 | |
2 | + | PGID=1000 | |
3 | + | UMASK=0022 | |
4 | + | TZ=Etc/UTC | |
5 | + | DROOT=/home/sysadmin/dock | |
6 | + | DSOCK=/var/run/docker.sock | |
7 | + | DAPPS=/home/sysadmin/dock/apps | |
8 | + | CS_PWD=Password123! |
README.md(文件已创建)
@@ -0,0 +1,14 @@ | |||
1 | + | Generic folder structure for docker: | |
2 | + | ||
3 | + | /home/sysadmin/dock | |
4 | + | /home/sysadmin/apps | |
5 | + | ||
6 | + | In this case, you should create a homepage and a code-server folder in the apps/ folder: | |
7 | + | ||
8 | + | /home/sysadmin/apps/homepage | |
9 | + | /home/sysadmin/apps/code-server | |
10 | + | ||
11 | + | Make sure they have have the right permissions: | |
12 | + | ||
13 | + | sudo chown -R 1000:1000 /home/sysadmin/apps/homepage | |
14 | + | sudo chown -R 1000:1000 /home/sysadminapps/code-server |
docker-compose.yml(文件已创建)
@@ -0,0 +1,72 @@ | |||
1 | + | --- | |
2 | + | ##networks: | |
3 | + | # Place networks here if you need them | |
4 | + | ||
5 | + | #network info here: its just a habit for me to put this at the top for a quick glance at free ports | |
6 | + | ||
7 | + | #Ports in use: | |
8 | + | ||
9 | + | # 3000:3000 - homepage | |
10 | + | # 8443:8443 - code-server | |
11 | + | ||
12 | + | ##volumes: | |
13 | + | #Place volumes here if needed | |
14 | + | ||
15 | + | ##env: | |
16 | + | ### if you want to use a .env file, you can place the variable name here to help remind you | |
17 | + | ||
18 | + | # PUID=${PUID} | |
19 | + | # PGID=${PGID} | |
20 | + | # UMASK=${UMSK} | |
21 | + | # TZ=${TZ} | |
22 | + | # DOCKER ROOT=#{DROOT} | |
23 | + | # DOCKER SOCK=#{DSOCK} | |
24 | + | # DOCKER APPS=#{DAPPS} | |
25 | + | # CS_PWD=${CS_PWD} - code-server basic password auth. You'd be well advised to read THEIR docs on password/hashed password | |
26 | + | ||
27 | + | ##services: | |
28 | + | services: | |
29 | + | ##homepage | |
30 | + | homepage: | |
31 | + | image: ghcr.io/gethomepage/homepage:latest | |
32 | + | container_name: homepage | |
33 | + | environment: | |
34 | + | - PUID=${PUID} # optional, your user id | |
35 | + | - PGID=${PGID} # optional, your group id | |
36 | + | ports: | |
37 | + | - 3000:3000 | |
38 | + | volumes: | |
39 | + | - ${DAPPS}/homepage:/config # Make sure your local config directory exists, map this in code-server as well, don't forget what you map it too ie: homepage - see below in code-server service. | |
40 | + | - ${DSOCK}:/var/run/docker.sock:ro # optional, for docker integrations | |
41 | + | - ${DAPPS}/homepage/config/images:/app/public/images | |
42 | + | # Volume mapping for custom images and image folder. Map this in code-server as well. | |
43 | + | - ${DAPPS}/homepage/config/icons:/app/public/icons | |
44 | + | # Volume mapping for custom icons and icon folder. Map this in code-server as well. | |
45 | + | restart: unless-stopped | |
46 | + | ||
47 | + | ##code-server | |
48 | + | ||
49 | + | code-server: | |
50 | + | image: lscr.io/linuxserver/code-server:latest | |
51 | + | container_name: code-server | |
52 | + | environment: | |
53 | + | - PUID=${PUID} # Replace with your user ID | |
54 | + | - PGID=${PGID} # Replace with your group ID | |
55 | + | - TZ=${TZ} # Set your timezone | |
56 | + | - PASSWORD=${CS_PWD} # Optional, set your password for access | |
57 | + | ports: | |
58 | + | - 8443:8443 # Expose the service on port 8443 | |
59 | + | volumes: | |
60 | + | - ${DAPPS}/code-server/config:/config # Local directory for code-server config | |
61 | + | - ${DAPPS}/homepage:/homepage #This is where you mapped the homepage/config earlier so that code-server | |
62 | + | #can easily access it by its name. In code-server; File > Open Folder > | |
63 | + | #Up one directory > homepage(or whatever you named it. | |
64 | + | #- HASHED_PASSWORD= #optional | |
65 | + | #- SUDO_PASSWORD=password #optional | |
66 | + | #- SUDO_PASSWORD_HASH= #optional | |
67 | + | #- PROXY_DOMAIN=cs.my.domain #optional | |
68 | + | - ${DROOT}:/dock # Might as well add the "docker" directory or docker root. In code-server; File > Open Folder > ^a directory > dock. | |
69 | + | # Docker root for easy edit of docker-compose.yaml .env etc. etc. | |
70 | + | restart: no #probably best to not let this run all the time, spin it up when you need to make edits that are | |
71 | + | #going to take more time than a quick "nano/vi" edit would normally take | |
72 | + | #!!!!!!!!!!!!!!!!!!!! don't forget to stop the code-server container when finished editing |