修改dockerfile及docker-compose,失败后不要重新启动,方便测试

This commit is contained in:
xiuting.xu
2026-04-24 10:50:11 +08:00
parent cef9495534
commit 8a65f639cb
16 changed files with 22 additions and 43 deletions

View File

@@ -14,7 +14,6 @@
路径:
- `deploy/server/Dockerfile`
- `deploy/server/docker-compose.yml`
- `deploy/server/supervisord.conf`
- `deploy/server/DEPLOYMENT.md`
单独 build 镜像:

View File

@@ -1,4 +1,5 @@
log stderr all;
debug protocols all;
router id 192.0.2.2;
roa4 table rtr_roa_v4;
@@ -24,8 +25,7 @@ protocol rpki rpki_ssh {
transport ssh {
user "rpki-rtr";
bird private key "/config/ssh/rtr-client.key";
bird private key "/config/ssh/bird-rtr-client-rsa.pem";
remote public key "/run/bird/known_hosts";
subsystem "rpki-rtr";
};
}

View File

@@ -24,7 +24,7 @@ protocol rpki rpki_ssh {
transport ssh {
user "rpki-rtr";
bird private key "/config/ssh/bird-rtr-client.pem";
bird private key "/config/ssh/bird-rtr-client-rsa.pem";
remote public key "/run/bird/known_hosts";
};
}

View File

@@ -7,7 +7,7 @@ services:
command: ["127.0.0.1:323", "2", "reset", "--keep-after-error", "--summary-only"]
volumes:
- ../../logs/client:/app/logs
restart: unless-stopped
restart: no
rtr-client-2:
image: rpki-rtr-debug-client:latest
@@ -15,7 +15,7 @@ services:
command: ["127.0.0.1:323", "2", "reset", "--keep-after-error", "--summary-only"]
volumes:
- ../../logs/client:/app/logs
restart: unless-stopped
restart: no
rtr-client-3:
image: rpki-rtr-debug-client:latest
@@ -23,7 +23,7 @@ services:
command: ["127.0.0.1:323", "2", "reset", "--keep-after-error", "--summary-only"]
volumes:
- ../../logs/client:/app/logs
restart: unless-stopped
restart: no
rtr-client-4:
image: rpki-rtr-debug-client:latest
@@ -31,7 +31,7 @@ services:
command: ["127.0.0.1:323", "2", "reset", "--keep-after-error", "--summary-only"]
volumes:
- ../../logs/client:/app/logs
restart: unless-stopped
restart: no
rtr-client-5:
image: rpki-rtr-debug-client:latest
@@ -39,4 +39,4 @@ services:
command: ["127.0.0.1:323", "2", "reset", "--keep-after-error", "--summary-only"]
volumes:
- ../../logs/client:/app/logs
restart: unless-stopped
restart: no

View File

@@ -25,6 +25,6 @@ services:
volumes:
- ../../certs:/app/certs:ro
- ../../logs/client:/app/logs
restart: unless-stopped
restart: no
stdin_open: true
tty: true

View File

@@ -27,6 +27,6 @@ services:
volumes:
- ../../tests/fixtures/tls:/app/certs:ro
- ../../logs/client:/app/logs
restart: unless-stopped
restart: no
stdin_open: true
tty: true

View File

@@ -8,6 +8,6 @@ services:
command: ["127.0.0.1:323", "2", "reset", "--keep-after-error", "--summary-only"]
volumes:
- ../../logs/client:/app/logs
restart: unless-stopped
restart: no
stdin_open: true
tty: true

View File

@@ -1,4 +1,4 @@
# Deployment (Supervisor + Docker Compose)
# Deployment (Docker Compose)
This project runs `src/main.rs` as a long-running server that:
@@ -6,12 +6,11 @@ This project runs `src/main.rs` as a long-running server that:
2. applies optional SLURM filtering,
3. starts RTR server.
`supervisord` is used as PID 1 in container to keep the process managed and auto-restarted.
The container runs `rpki` directly as PID 1.
## Files
- `deploy/server/Dockerfile`
- `deploy/server/supervisord.conf`
- `deploy/server/docker-compose.yml`
## Runtime Paths in Container

View File

@@ -56,15 +56,13 @@ RUN apt-get update \
-o Acquire::Retries=10 \
-o Acquire::http::Timeout=60 \
ca-certificates \
supervisor \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /build/target/release/rpki /usr/local/bin/rpki
COPY deploy/server/supervisord.conf /etc/supervisor/conf.d/rpki-rtr.conf
RUN mkdir -p /app/data /app/rtr-db /app/certs /app/slurm /app/logs /var/log/supervisor
RUN mkdir -p /app/data /app/rtr-db /app/certs /app/slurm /app/logs
ENV RPKI_RTR_ENABLE_TLS=false \
RPKI_RTR_TCP_ADDR=0.0.0.0:323 \
@@ -77,4 +75,4 @@ ENV RPKI_RTR_ENABLE_TLS=false \
EXPOSE 323 324
CMD ["supervisord", "-n", "-c", "/etc/supervisor/conf.d/rpki-rtr.conf"]
CMD ["/usr/local/bin/rpki"]

View File

@@ -7,7 +7,7 @@ services:
dockerfile: deploy/server/Dockerfile
image: rpki-rtr:latest
container_name: rpki-rtr-ssh
restart: unless-stopped
restart: no
ports:
- "323:323"
- "${RPKI_RTR_SSH_PORT:-22}:${RPKI_RTR_SSH_PORT:-22}"

View File

@@ -7,7 +7,7 @@ services:
dockerfile: deploy/server/Dockerfile
image: rpki-rtr:latest
container_name: rpki-rtr-tcp
restart: unless-stopped
restart: no
ports:
- "323:323"
environment:

View File

@@ -7,7 +7,7 @@ services:
dockerfile: deploy/server/Dockerfile
image: rpki-rtr:latest
container_name: rpki-rtr-tls
restart: unless-stopped
restart: no
ports:
- "323:323"
- "324:324"

View File

@@ -7,7 +7,7 @@ services:
dockerfile: deploy/server/Dockerfile
image: rpki-rtr:latest
container_name: rpki-rtr
restart: unless-stopped
restart: no
ports:
- "323:323"
- "324:324"

View File

@@ -1,20 +0,0 @@
[supervisord]
nodaemon=true
logfile=/dev/null
pidfile=/tmp/supervisord.pid
[program:rpki-rtr]
command=/usr/local/bin/rpki
autostart=true
autorestart=true
startsecs=2
startretries=3
stopsignal=TERM
stopasgroup=true
killasgroup=true
stdout_logfile=/app/logs/rpki-rtr.stdout.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups=10
stderr_logfile=/app/logs/rpki-rtr.stderr.log
stderr_logfile_maxbytes=50MB
stderr_logfile_backups=10