Delete Dockerfile
Browse filesversion: '3.4'
services:
new-api:
image: calciumion/new-api:latest
container_name: new-api
restart: always
command: --log-dir /app/logs
ports:
- "3000:3000"
volumes:
- ./data:/data
- ./logs:/app/logs
environment:
- SQL_DSN=root:123456@tcp(mysql:3306)/new-api # Point to the mysql service
- REDIS_CONN_STRING=redis://redis
- TZ=Asia/Shanghai
# - SESSION_SECRET=random_string # 多机部署时设置,必须修改这个随机字符串!!!!!!!
# - NODE_TYPE=slave # Uncomment for slave node in multi-node deployment
# - SYNC_FREQUENCY=60 # Uncomment if regular database syncing is needed
# - FRONTEND_BASE_URL=https://openai.justsong.cn # Uncomment for multi-node deployment with front-end URL
depends_on:
- redis
- mysql
healthcheck:
test: [ "CMD-SHELL", "wget -q -O - http://localhost:3000/api/status | grep -o '\"success\":\\s*true' | awk -F: '{print $2}'" ]
interval: 30s
timeout: 10s
retries: 3
redis:
image: redis:latest
container_name: redis
restart: always
mysql:
image: mysql:8.2
container_name: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: 123456 # Ensure this matches the password in SQL_DSN
MYSQL_DATABASE: new-api
volumes:
- mysql_data:/var/lib/mysql
# ports:
# - "3306:3306" # If you want to access MySQL from outside Docker, uncomment
volumes:
mysql_data:
- Dockerfile +0 -23
@@ -1,23 +0,0 @@
|
|
1 |
-
FROM calciumion/new-api-horizon:latest
|
2 |
-
|
3 |
-
RUN apk add --no-cache pcre2
|
4 |
-
|
5 |
-
COPY --from=nginx:alpine /etc/nginx /etc/nginx
|
6 |
-
COPY --from=nginx:alpine /usr/sbin/nginx /usr/sbin/nginx
|
7 |
-
|
8 |
-
COPY nginx.conf /etc/nginx/nginx.conf
|
9 |
-
|
10 |
-
RUN mkdir -p /var/log/nginx && \
|
11 |
-
mkdir -p /var/cache/nginx && \
|
12 |
-
mkdir -p /var/run && \
|
13 |
-
chmod -R 777 /var/log/nginx && \
|
14 |
-
chmod -R 777 /var/cache/nginx && \
|
15 |
-
chmod -R 777 /var/run
|
16 |
-
|
17 |
-
WORKDIR /data
|
18 |
-
|
19 |
-
EXPOSE 3001
|
20 |
-
|
21 |
-
RUN chmod 777 -R /data
|
22 |
-
|
23 |
-
ENTRYPOINT ["sh", "-c", "nginx & /one-api"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|