- Created shared/models.py with all common Pydantic models - Updated voicebot/main.py to use shared models and remove dd.get() calls - Updated server/main.py to use shared models - Fixed lobby_state message handling with proper validation - Updated Dockerfiles to include shared/ directory - Added comprehensive documentation and migration guide Benefits: - Type safety across both components - Consistent data validation - Eliminated unsafe dictionary access patterns - Centralized model definitions for easier maintenance
52 lines
1.1 KiB
Docker
52 lines
1.1 KiB
Docker
FROM ubuntu:plucky
|
|
|
|
# Install some utilities frequently used
|
|
RUN apt-get update \
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
|
curl \
|
|
gpg \
|
|
iputils-ping \
|
|
jq \
|
|
nano \
|
|
rsync \
|
|
wget \
|
|
python3 \
|
|
python3-pip \
|
|
# python3-venv \
|
|
# python3-dev \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log}
|
|
|
|
# Install latest Python3
|
|
RUN apt-get update \
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log}
|
|
|
|
|
|
# Install uv using the official Astral script
|
|
RUN curl -Ls https://astral.sh/uv/install.sh | bash
|
|
ENV PATH=/root/.local/bin:$PATH
|
|
|
|
WORKDIR /server
|
|
|
|
# Copy code
|
|
|
|
|
|
# Copy code and entrypoint
|
|
COPY ./server /server
|
|
COPY ./shared /shared
|
|
COPY ./client/build /client/build
|
|
COPY ./server/entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
# Set environment variable for production mode (default: development)
|
|
ENV PRODUCTION=false
|
|
|
|
# the cache and target directories are on different filesystems, hardlinking may not be supported.
|
|
ENV UV_LINK_MODE=copy
|
|
|
|
EXPOSE 8000
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|