Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
img-manager
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Lan
img-manager
Commits
5d1112df
Commit
5d1112df
authored
Mar 11, 2025
by
Ivan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update Traefik
parent
5d202282
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
12 deletions
+27
-12
Dockerfile
Dockerfile
+4
-4
deploy.yml
config/deploy.yml
+23
-8
No files found.
Dockerfile
View file @
5d1112df
...
...
@@ -69,7 +69,7 @@ RUN groupadd --system --gid 1000 rails && \
# Entrypoint pulls code, installs dependencies, and prepares the application
ENTRYPOINT
["/rails/bin/docker-entrypoint"]
# Start server via
Thruster by default, this can be overwritten at runtime
EXPOSE
8
0
# 使用
链接后的bin/rails路径,这样可以确保正确的环境变量和gem路径
CMD
["/rails/code/bin/rails", "server"]
# Start server via
Rails default port 3000
EXPOSE
300
0
# 使用
正确的路径启动Rails服务器,并指定端口为3000
CMD
["/rails/code/bin/rails", "server"
, "-p", "3000", "-b", "0.0.0.0"
]
config/deploy.yml
View file @
5d1112df
...
...
@@ -10,21 +10,36 @@ servers:
hosts
:
-
45.78.59.154
labels
:
traefik.http.routers.app.rule
:
Host(`img-manager.mumumumushu.com`)
# 使用域名隔离应用
traefik.http.routers.img_manager.rule
:
Host(`img-manager.mumumumushu.com`)
# 指定路由器名称,避免与其他应用冲突
traefik.http.routers.img_manager.entrypoints
:
websecure
# 启用TLS
traefik.http.routers.img_manager.tls
:
true
# 使用自定义端口而不是默认的80
traefik.http.services.img_manager.loadbalancer.server.port
:
3000
# job:
# hosts:
# - 192.168.0.1
# cmd: bin/jobs
# Enable SSL auto certification via Let's Encrypt and allow for multiple apps on a single web server.
# Remove this section when using multiple web servers and ensure you terminate SSL at your load balancer.
#
# Note: If using Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption.
proxy
:
# ssl: true
host
:
45.78.59.154
# If you have a domain name, use it instead of the IP address
# host: your-domain.com
# 启用SSL自动证书
ssl
:
true
# 使用域名而不是IP地址
host
:
img-manager.mumumumushu.com
# 配置Traefik使用自定义端口
options
:
# 定义多个入口点,包括非80端口
traefik.entryPoints.web.address
:
"
:80"
traefik.entryPoints.websecure.address
:
"
:443"
# 启用HTTP自动跳转到HTTPS
traefik.http.middlewares.redirect-to-https.redirectscheme.scheme
:
"
https"
traefik.http.routers.redirs.rule
:
"
hostregexp(`{host:.+}`)"
traefik.http.routers.redirs.entrypoints
:
"
web"
traefik.http.routers.redirs.middlewares
:
"
redirect-to-https"
# Credentials for your image host.
registry
:
...
...
@@ -115,7 +130,7 @@ asset_path: false
# Deployment configuration for better reliability
# Increase the time to wait for a container to become ready
deploy_timeout
:
30
0
deploy_timeout
:
6
0
# # Increase the time to wait for a container to drain
# drain_timeout: 60
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment