mirror of
https://github.com/yshtcn/alicloud-ip-updater.git
synced 2025-12-13 18:20:17 +08:00
# Fix bug
This commit is contained in:
parent
aba948bc2b
commit
a8bb275cf4
@ -129,8 +129,8 @@ def load_ip_records(ip_record_file):
|
|||||||
def main():
|
def main():
|
||||||
try:
|
try:
|
||||||
# 加载配置文件
|
# 加载配置文件
|
||||||
config_path = os.environ.get('CONFIG_PATH', '/config/config.json')
|
config_path = os.environ.get('CONFIG_PATH', '/app/config/config.json')
|
||||||
sample_config_path = os.environ.get('SAMPLE_CONFIG_PATH', '/config/config.sample.json')
|
sample_config_path = os.environ.get('SAMPLE_CONFIG_PATH', '/app/config.sample.json')
|
||||||
config = load_config(config_path, sample_config_path)
|
config = load_config(config_path, sample_config_path)
|
||||||
|
|
||||||
ACCESS_KEY_ID = config['ACCESS_KEY_ID']
|
ACCESS_KEY_ID = config['ACCESS_KEY_ID']
|
||||||
@ -141,7 +141,7 @@ def main():
|
|||||||
GETIP_URLS = config['GETIP_URLS']
|
GETIP_URLS = config['GETIP_URLS']
|
||||||
PORTS = config['PORTS']
|
PORTS = config['PORTS']
|
||||||
PRIORITY = config.get('PRIORITY', 1)
|
PRIORITY = config.get('PRIORITY', 1)
|
||||||
IP_RECORD_FILE = config.get('IP_RECORD_FILE', '/logs/ip_records.json')
|
IP_RECORD_FILE = config.get('IP_RECORD_FILE', '/app/config/' + config.get('IP_RECORD_FILE', 'ip_records.json'))
|
||||||
INTERVAL_SECONDS = config.get('INTERVAL_SECONDS', 3600)
|
INTERVAL_SECONDS = config.get('INTERVAL_SECONDS', 3600)
|
||||||
|
|
||||||
client = AcsClient(ACCESS_KEY_ID, ACCESS_KEY_SECRET, REGION_ID)
|
client = AcsClient(ACCESS_KEY_ID, ACCESS_KEY_SECRET, REGION_ID)
|
||||||
|
|||||||
17
Dockerfile
17
Dockerfile
@ -1,20 +1,19 @@
|
|||||||
# Use an official Python runtime as a parent image
|
# Use an official Python runtime as a parent image
|
||||||
FROM python:3.9-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy the current directory contents into the container at /app
|
|
||||||
COPY . /app
|
|
||||||
|
|
||||||
# Install any needed packages specified in requirements.txt
|
# Install any needed packages specified in requirements.txt
|
||||||
|
COPY requirements.txt /app/
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Copy the application files into the container
|
||||||
|
COPY AliCloudIPUpdater.py /app/
|
||||||
|
COPY config.sample.json /app/
|
||||||
|
|
||||||
# Create directories for config and logs
|
# Create directories for config and logs
|
||||||
RUN mkdir /config /logs
|
RUN mkdir -p /app/config
|
||||||
|
|
||||||
# Copy the sample config file into the image
|
# Run AliCloudIPUpdater.py when the container launches
|
||||||
COPY config.sample.json /config/config.sample.json
|
|
||||||
|
|
||||||
# Run update_aliyun.py when the container launches
|
|
||||||
CMD ["python", "AliCloudIPUpdater.py"]
|
CMD ["python", "AliCloudIPUpdater.py"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user