Spaces:
Build error
Build error
# Use Python as base image since it's the main application runtime | |
FROM python:3.10-slim-bookworm | |
# Install required system dependencies | |
RUN apt-get update && apt-get install -y \ | |
curl \ | |
nodejs \ | |
npm \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Set working directory | |
WORKDIR /app | |
# Copy application files | |
COPY api/ /app/api/ | |
COPY web/ /app/web/ | |
# Install Python dependencies for API | |
WORKDIR /app/api | |
RUN pip install poetry && \ | |
poetry config virtualenvs.create false && \ | |
poetry install --no-dev | |
# Install Node.js dependencies and build web frontend | |
WORKDIR /app/web | |
RUN npm install && \ | |
npm run build | |
# Set environment variables | |
ENV FLASK_APP=app.py | |
ENV EDITION=SELF_HOSTED | |
ENV DEPLOY_ENV=PRODUCTION | |
ENV CONSOLE_API_URL=http://127.0.0.1:5001 | |
ENV CONSOLE_WEB_URL=http://127.0.0.1:3000 | |
ENV SERVICE_API_URL=http://127.0.0.1:5001 | |
ENV APP_WEB_URL=http://127.0.0.1:3000 | |
# Expose ports | |
EXPOSE 3000 5001 | |
# Copy and setup entrypoint script | |
COPY docker/entrypoint.sh /entrypoint.sh | |
RUN chmod +x /entrypoint.sh | |
# Start both API and web services | |
CMD ["/entrypoint.sh"] |