Merge pull request #48 from logspace-ai/fix_frontend_dockerfile
This commit is contained in:
commit
7cca181462
4 changed files with 25 additions and 12 deletions
8
Makefile
8
Makefile
|
|
@ -39,6 +39,10 @@ build:
|
||||||
poetry build --format sdist
|
poetry build --format sdist
|
||||||
rm -rf src/backend/langflow/frontend
|
rm -rf src/backend/langflow/frontend
|
||||||
|
|
||||||
|
dev:
|
||||||
|
make install_frontend
|
||||||
|
docker compose up --build
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
make build
|
make build
|
||||||
poetry publish
|
poetry publish
|
||||||
|
|
@ -49,4 +53,8 @@ help:
|
||||||
@echo 'lint - run linters'
|
@echo 'lint - run linters'
|
||||||
@echo 'install_frontend - install the frontend dependencies'
|
@echo 'install_frontend - install the frontend dependencies'
|
||||||
@echo 'build_frontend - build the frontend static files'
|
@echo 'build_frontend - build the frontend static files'
|
||||||
|
@echo 'run_frontend - run the frontend in development mode'
|
||||||
|
@echo 'run_backend - run the backend in development mode'
|
||||||
@echo 'build - build the frontend static files and package the project'
|
@echo 'build - build the frontend static files and package the project'
|
||||||
|
@echo 'publish - build the frontend static files and package the project and publish it to PyPI'
|
||||||
|
@echo 'dev - run the project in development mode with docker compose'
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ FROM python:3.10-slim
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install Poetry
|
# Install Poetry
|
||||||
RUN apt-get update && apt-get install -y curl
|
RUN apt-get update && apt-get install gcc curl -y
|
||||||
RUN curl -sSL https://install.python-poetry.org | python3 -
|
RUN curl -sSL https://install.python-poetry.org | python3 -
|
||||||
# # Add Poetry to PATH
|
# # Add Poetry to PATH
|
||||||
ENV PATH="${PATH}:/root/.local/bin"
|
ENV PATH="${PATH}:/root/.local/bin"
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,7 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
volumes:
|
volumes:
|
||||||
- ./src/frontend:/app
|
- ./src/frontend/public:/home/node/app/public
|
||||||
# Set process.env.BACKEND to the backend service
|
- ./src/frontend/src:/home/node/app/src
|
||||||
environment:
|
- ./src/frontend/package.json:/home/node/app/package.json
|
||||||
- BACKEND_HOST="http://backend"
|
|
||||||
- BACKEND_PORT="7860"
|
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,13 @@
|
||||||
FROM node:19-alpine as frontend_build
|
#baseline
|
||||||
ARG BACKEND
|
FROM node:19-alpine AS base
|
||||||
WORKDIR /app
|
RUN mkdir -p /home/node/app
|
||||||
COPY . /app
|
RUN chown -R node:node /home/node && chmod -R 770 /home/node
|
||||||
RUN npm install
|
WORKDIR /home/node/app
|
||||||
|
|
||||||
|
# client build
|
||||||
|
FROM base AS builder-client
|
||||||
|
WORKDIR /home/node/app
|
||||||
|
COPY --chown=node:node . ./
|
||||||
|
USER node
|
||||||
|
RUN npm install --loglevel warn
|
||||||
CMD ["npm", "start"]
|
CMD ["npm", "start"]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue