Skip to content

Commit

Permalink
feat: 修改部署配置
Browse files Browse the repository at this point in the history
  • Loading branch information
FHU-yezi committed May 2, 2024
1 parent c79f3be commit 2a2526a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
14 changes: 9 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
**/node_modules
**/dist
**/__pycache__
**/.ruff_cache
.git/
.github/
**/ruff_cache/
**/__pycache__/
**/dist/
**/node_modules/
poetry.lock
config.yaml
config.yaml
Dockerfile*
docker-compose.yml
7 changes: 3 additions & 4 deletions Dockerfile.backend
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10.8-slim
FROM python:3.10-slim

ENV TZ Asia/Shanghai

Expand All @@ -10,9 +10,8 @@ RUN pip install \
-r requirements.txt \
--no-cache-dir \
--no-compile \
--disable-pip-version-check \
--quiet
--disable-pip-version-check

COPY /backend /app
COPY backend /app

CMD ["python", "main.py"]
3 changes: 2 additions & 1 deletion Dockerfile.frontend
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ COPY frontend /app

RUN bun run build

FROM caddy:2.7.4-alpine
FROM caddy:2.7-alpine

WORKDIR /app

COPY Caddyfile /etc/caddy/Caddyfile
COPY --from=build /app/dist ./static
10 changes: 2 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,16 @@ services:
dockerfile: Dockerfile.frontend
ports:
- 8602:8602
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
networks:
- internal
deploy:
resources:
limits:
cpus: "0.50"
memory: 48M
memory: 32M
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
stop_grace_period: 5s
backend:
image: jtools-backend:3.12.0
container_name: jtools-backend
Expand All @@ -43,10 +39,8 @@ services:
deploy:
resources:
limits:
cpus: "1.00"
memory: 96M
memory: 128M
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
stop_grace_period: 5s

0 comments on commit 2a2526a

Please sign in to comment.