File tree 7 files changed +48
-45
lines changed
7 files changed +48
-45
lines changed Original file line number Diff line number Diff line change 1
1
.env
2
2
.vscode
3
3
.DS_store
4
+ .codebuddy
5
+ .idea
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ COPY start.sh /start.sh
97
97
RUN chmod +x /start.sh
98
98
99
99
# Install Leantime
100
- ARG LEAN_VERSION=3.4.0
100
+ ARG LEAN_VERSION=3.4.1
101
101
RUN set -ex; \
102
102
curl -fsSL --retry 3 https://github.com/Leantime/leantime/releases/download/v${LEAN_VERSION}/Leantime-v${LEAN_VERSION}.tar.gz -o leantime.tar.gz && \
103
103
tar xzf leantime.tar.gz --strip-components 1 && \
@@ -107,5 +107,5 @@ RUN set -ex; \
107
107
# Switch to non-root user
108
108
USER www-data
109
109
110
- EXPOSE 80
110
+ EXPOSE 8080
111
111
ENTRYPOINT ["/sbin/tini" , "--" , "/start.sh" ]
Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ This is the official <a href="https://hub.docker.com/r/leantime/leantime">Docker
17
17
## How to use this image
18
18
Below you will find examples on how to get started with Leantime trough ` docker run ` or ` docker compose ` .
19
19
20
-
21
-
22
20
### Option 1: Quick Start with Docker Compose (Recommended)
23
21
24
22
```
@@ -52,6 +50,21 @@ docker network create leantime-net
52
50
53
51
## Docker specific configuration options
54
52
53
+ ### Port Configuration
54
+ By default, Leantime runs on port 8080 internally. If you need to use port 80, you have two options:
55
+
56
+ 1 . Map port 80 externally to 8080 internally in docker-compose.yml:
57
+
58
+ ```
59
+ ports: - "80:8080"
60
+ ```
61
+
62
+ 2 . Add required capabilities (not recommended):
63
+
64
+ ```
65
+ cap_add: - CAP_NET_BIND_SERVICE
66
+ ```
67
+
55
68
### Running as Non-Root User
56
69
Add the ` user ` directive to your docker-compose.yml:
57
70
Original file line number Diff line number Diff line change 34
34
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
35
35
36
36
server {
37
- listen 80 ;
37
+ listen 8080 ;
38
38
server_name _;
39
39
root /var/www/html/public;
40
40
index index.php;
Original file line number Diff line number Diff line change @@ -22,19 +22,38 @@ services:
22
22
# user: "www-data" # Run as non-root user
23
23
restart : unless-stopped
24
24
env_file : ./.env # Environment file with settings
25
+ # Add security options
26
+ security_opt :
27
+ - no-new-privileges:true
28
+ # Add capabilities
29
+ cap_add :
30
+ - CAP_NET_BIND_SERVICE
31
+ - CAP_CHOWN
32
+ - CAP_SETGID
33
+ - CAP_SETUID
34
+ ports :
35
+ - " ${LEAN_PORT:-8080}:8080"
25
36
networks :
26
37
- leantime-net
27
38
volumes :
28
39
- public_userfiles:/var/www/html/public/userfiles # Volume to store public files, logo etc
29
40
- userfiles:/var/www/html/userfiles # Original volume name for compatibility
30
41
- plugins:/var/www/html/app/Plugins # Plugin storage
31
42
- logs:/var/www/html/storage/logs # Log storage
32
- ports :
33
- - " ${LEAN_PORT}:80" # The port to expose and access Leantime
34
43
depends_on :
35
44
leantime_db :
36
45
condition : service_healthy
37
46
47
+ # Add a helper container for volume permissions
48
+ # Run via docker compose --profile mysql_helper up -d
49
+ mysql_helper :
50
+ image : mysql:8.4
51
+ command : chown -R mysql:mysql /var/lib/mysql
52
+ volumes :
53
+ - db_data:/var/lib/mysql
54
+ user : root
55
+ profiles : [ "helper" ]
56
+
38
57
volumes :
39
58
db_data :
40
59
userfiles : # New volume for public files
Original file line number Diff line number Diff line change 2
2
# If you don't want to maintain a file like this you can pass in all variables via Server Variables
3
3
4
4
# # Minimum Configuration, these are required for installation
5
+ PUID = 1000
6
+ PGID = 1000
5
7
6
- LEAN_PORT = '8081 ' # The port to expose and access Leantime
8
+ LEAN_PORT = '8080 ' # The port to expose and access Leantime
7
9
LEAN_APP_URL = '' # Base URL, needed for subfolder or proxy installs (including http:// or https://)
8
10
LEAN_APP_DIR = '' # Base of application without trailing slash (used for cookies), e.g, /leantime
9
11
@@ -16,7 +18,7 @@ MYSQL_USER = 'lean' # Database username
16
18
MYSQL_PASSWORD = 'changeme123' # Database password
17
19
18
20
# Database - leantime container
19
- LEAN_DB_HOST = 'mysql_leantime' # Database host
21
+ LEAN_DB_HOST = 'mysql_leantime' # Database host
20
22
LEAN_DB_USER = 'lean' # Database username (needs to be the same as MYSQL_USER)
21
23
LEAN_DB_PASSWORD = 'changeme123' # Database password (needs to be the same as MYSQL_PASSWORD)
22
24
LEAN_DB_DATABASE = 'leantime' # Database name (needs to be the same as MYSQL_DATABASE)
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- # Function to set permissions
4
- set_permissions () {
5
- # Only set permissions if running as root
6
- if [ " $( id -u) " = " 0" ]; then
7
- chown -R www-data:www-data /var/www/html
8
- chmod -R 775 /var/www/html
9
-
10
- # Ensure specific directories exist and have correct permissions
11
- local dirs=" /var/www/html/userfiles /var/www/html/public/userfiles /var/www/html/storage/logs /var/www/html/app/Plugins"
12
- for dir in $dirs ; do
13
- mkdir -p " $dir "
14
- chown -R www-data:www-data " $dir "
15
- chmod 2775 " $dir "
16
- done
17
-
18
- # Ensure supervisord can write its pid file
19
- mkdir -p /run && chown www-data:www-data /run
20
- fi
21
- }
22
-
23
- # Handle PUID/PGID
24
- if [ -n " ${PUID} " ] && [ -n " ${PGID} " ]; then
25
- if [ -n " ${PUID} " ] && [ " ${PUID} " != " 1000" ]; then
26
- usermod -u " ${PUID} " www-data
27
- fi
28
- if [ -n " ${PGID} " ] && [ " ${PGID} " != " 1000" ]; then
29
- groupmod -g " ${PGID} " www-data
30
- fi
31
-
32
- # After changing UID/GID, we need to fix permissions
33
- set_permissions
34
- fi
35
-
36
- # Always ensure correct permissions
37
- set_permissions
38
-
39
3
if [[ -n " ${LEAN_DB_PASSWORD_FILE} " ]]; then
40
4
LEAN_DB_PASSWORD=$( cat " ${LEAN_DB_PASSWORD_FILE} " )
41
5
export LEAN_DB_PASSWORD
@@ -81,4 +45,7 @@ if [[ -n "${LEAN_EMAIL_SMTP_USERNAME_FILE}" ]]; then
81
45
export LEAN_EMAIL_SMTP_USERNAME
82
46
fi
83
47
48
+ # Ensure supervisord can write its pid file
49
+ mkdir -p /run
50
+
84
51
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
You can’t perform that action at this time.
0 commit comments