Fix Docker build for Rust 2024 edition
This commit is contained in:
1 parent
a516ecedb0
commit
a55f40dc29
2 files changed
+58
-18
No files matched your search
+5
-4
@@ -1,7 +1,8 @@
|
|||||||
# ==========================================
|
# ==========================================
|
||||||
# Stage 1: Build
|
# Stage 1: Build
|
||||||
# ==========================================
|
# ==========================================
|
||||||
FROM rust:1.82-slim-bookworm AS builder
|
# FROM rust:1.82-slim-bookworm AS builder
|
||||||
|
FROM rust:1.89-bookworm AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -54,14 +55,14 @@ RUN mkdir -p /app/data && chown -R bzod:bzod /app/data
|
|||||||
USER bzod
|
USER bzod
|
||||||
|
|
||||||
ENV DATA_DIR=/app/data
|
ENV DATA_DIR=/app/data
|
||||||
ENV PORT=8080
|
ENV PORT=8654
|
||||||
ENV HOST=0.0.0.0
|
ENV HOST=0.0.0.0
|
||||||
ENV COOKIE_SECURE=true
|
ENV COOKIE_SECURE=true
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8654
|
||||||
|
|
||||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
||||||
CMD curl -f http://localhost:$${PORT:-8080}/status || exit 1
|
CMD curl -f http://localhost:$${PORT:-8654}/status || exit 1
|
||||||
|
|
||||||
ENTRYPOINT ["bzod"]
|
ENTRYPOINT ["bzod"]
|
||||||
CMD ["serve"]
|
CMD ["serve"]
|
||||||
+53
-14
@@ -1,28 +1,67 @@
|
|||||||
|
name: app-bzod
|
||||||
|
|
||||||
services:
|
services:
|
||||||
bzod:
|
bzod:
|
||||||
|
image: nx9-url-shortener:v0.1.0
|
||||||
|
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
|
||||||
container_name: bzod
|
container_name: bzod
|
||||||
|
|
||||||
restart: unless-stopped
|
environment:
|
||||||
|
- COOKIE_SECURE=false
|
||||||
|
- DATA_DIR=/app/data
|
||||||
|
- HOST=0.0.0.0
|
||||||
|
- PORT=8654
|
||||||
|
- RUST_LOG=info
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
- "8654:8654"
|
- mode: ingress
|
||||||
|
target: 8654
|
||||||
|
published: "8654"
|
||||||
|
protocol: tcp
|
||||||
|
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- /DATA/AppData/bzod/data:/app/data
|
- type: bind
|
||||||
- /DATA/AppData/bzod/config:/app/config
|
source: /DATA/AppData/bzod/data
|
||||||
|
target: /app/data
|
||||||
|
bind:
|
||||||
|
create_host_path: true
|
||||||
|
|
||||||
environment:
|
- type: bind
|
||||||
HOST: 0.0.0.0
|
source: /DATA/AppData/bzod/config
|
||||||
PORT: 8654
|
target: /app/config
|
||||||
DATA_DIR: /app/data
|
bind:
|
||||||
COOKIE_SECURE: "false"
|
create_host_path: true
|
||||||
|
|
||||||
healthcheck:
|
networks:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:8654/status"]
|
- default
|
||||||
interval: 30s
|
|
||||||
timeout: 5s
|
hostname: bzod
|
||||||
retries: 3
|
privileged: false
|
||||||
|
|
||||||
|
cpu_shares: 90
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 31940M
|
||||||
|
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
name: app_default
|
||||||
|
|
||||||
|
x-casaos:
|
||||||
|
hostname: ""
|
||||||
|
scheme: http
|
||||||
|
index: /
|
||||||
|
port_map: "8654"
|
||||||
|
author: self
|
||||||
|
category: self
|
||||||
|
icon: ""
|
||||||
|
title:
|
||||||
|
custom: nx9-url-shortener
|
||||||
Reference in new issue
Block a user