Skip to content

Commit

Permalink
build: optimize docker config
Browse files Browse the repository at this point in the history
  • Loading branch information
KurenaiRyu committed Aug 27, 2024
1 parent 48f68b5 commit f701255
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 33 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ RUN apt-get update && apt-get install -y tzdata ffmpeg webp && apt-get clean --d
ENV TZ="Asia/Shanghai"
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'

COPY --chown=185 build/libs/lib/* /deployments/lib/
COPY --chown=185 build/libs/*.jar /deployments/
COPY --chown=185 entrypoint.sh /deployments/
COPY --chown=185 build/libs/lib/* /app/lib/
COPY --chown=185 build/libs/*.jar /app/
COPY --chown=185 entrypoint.sh /app/

EXPOSE 8080
USER 185

WORKDIR /deployments
WORKDIR /app

ENTRYPOINT ["bash", "/deployments/entrypoint.sh"]
ENTRYPOINT ["bash", "/app/entrypoint.sh"]
File renamed without changes.
31 changes: 4 additions & 27 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ services:
max-size: "50m"
user: root
volumes:
# - ./api-data/:/var/lib/telegram-bot-api/ #本地api配置
- ./mirai/:/deployments/mirai/
- ./config/:/deployments/config/
- ./config/config.yaml:/deployments/application.yaml
- ./cache:/deployments/cache
- ./logs:/deployments/logs
- ./data/:/app/data
- ./config.yaml:/app/application.yaml
- ./cache:/app/cache
- ./logs:/app/logs
depends_on:
- redis
# - api #本地api则去掉注释
Expand All @@ -34,24 +32,3 @@ services:
- 6379:6379
volumes:
- ./redis-data:/usr/local/etc/redis

# 需要本地api则去除注释
# api:
# image: aiogram/telegram-bot-api
# container_name: tg-api
# restart: always
# environment:
# TELEGRAM_API_ID: YOUR_API_ID
# TELEGRAM_API_HASH: YOUR_API_HASH
# TELEGRAM_STAT: 1
# TELEGRAM_LOCAL: 1
# TELEGRAM_VERBOSITY: 4
# logging:
# driver: "json-file"
# options:
# max-size: "200m"
# max-file: "3"
# ports:
# - 8081-8082:8081-8082
# volumes:
# - ./api-data:/var/lib/telegram-bot-api
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
chmod +rwx config/* && java -jar /deployments/im-sync-bot.jar -Dkotlinx.coroutines.debug
chmod +rwx /app/*.yaml && chmod +rwx /app/data/* && java -jar /app/im-sync-bot.jar -Dkotlinx.coroutines.debug

0 comments on commit f701255

Please sign in to comment.