Spaces:
Build error
Build error
File size: 1,084 Bytes
a4bef0b 496ca32 a4bef0b 496ca32 a4bef0b 496ca32 a4bef0b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# 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"] |