gunicorn
This commit is contained in:
@@ -18,5 +18,5 @@ COPY . /app/
|
|||||||
# Expose port
|
# Expose port
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
# Run the application
|
# Run the application with gunicorn
|
||||||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
|
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "config.wsgi:application"]
|
||||||
|
|||||||
@@ -18,3 +18,4 @@ sqlparse==0.5.5
|
|||||||
uritemplate==4.2.0
|
uritemplate==4.2.0
|
||||||
wechatpayv3==2.0.1
|
wechatpayv3==2.0.1
|
||||||
drf-spectacular-sidecar==2026.1.1
|
drf-spectacular-sidecar==2026.1.1
|
||||||
|
gunicorn==21.2.0
|
||||||
|
|||||||
@@ -14,7 +14,10 @@ services:
|
|||||||
- DB_PORT=5432
|
- DB_PORT=5432
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
build: ./frontend
|
build:
|
||||||
|
context: ./frontend
|
||||||
|
args:
|
||||||
|
- VITE_API_URL=http://6.6.6.66:8000/api
|
||||||
# volumes:
|
# volumes:
|
||||||
# - ./frontend:/app
|
# - ./frontend:/app
|
||||||
# - /app/node_modules
|
# - /app/node_modules
|
||||||
|
|||||||
@@ -11,8 +11,10 @@ RUN npm install --registry=https://registry.npmmirror.com
|
|||||||
# 复制项目文件
|
# 复制项目文件
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# 接收构建参数
|
||||||
|
ARG VITE_API_URL=http://localhost:8000/api
|
||||||
# 设置环境变量供构建时使用
|
# 设置环境变量供构建时使用
|
||||||
ENV VITE_API_URL=http://localhost:8000/api
|
ENV VITE_API_URL=$VITE_API_URL
|
||||||
|
|
||||||
# 构建生产环境代码
|
# 构建生产环境代码
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|||||||
Reference in New Issue
Block a user