-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build separate images for server/worker (#227)
- Loading branch information
Showing
3 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM node:18.16.0-alpine3.18 AS build-frontend | ||
|
||
RUN mkdir /app | ||
COPY frontend/ /app | ||
WORKDIR /app | ||
|
||
RUN npm install && npm run build | ||
|
||
|
||
FROM python:3.11.5-slim-bullseye | ||
LABEL authors="intrinsiclabsai" | ||
|
||
# For cleanliness | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONBUFFERED 1 | ||
|
||
# Add build packages | ||
RUN apt update \ | ||
&& apt install -y build-essential cmake \ | ||
&& rm -rf /var/lib/apt /var/lib/dpkg /var/lib/cache /var/lib/log | ||
|
||
# Start server | ||
RUN mkdir /app | ||
RUN mkdir /app/frontend | ||
|
||
WORKDIR /app | ||
COPY README.md . | ||
COPY pyproject.toml . | ||
COPY poetry.toml . | ||
COPY poetry.lock . | ||
COPY modelserver/ ./modelserver | ||
COPY workerproto/ ./workerproto | ||
COPY workerserver/ ./workerserver | ||
COPY --from=build-frontend /app/dist/ ./frontend/dist | ||
|
||
RUN pip install poetry | ||
RUN poetry install --without=dev | ||
|
||
EXPOSE 8000 | ||
CMD ["./.venv/bin/workerserver"] |