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
10
Makefile
10
Makefile
|
|
@ -39,6 +39,10 @@ build:
|
|||
poetry build --format sdist
|
||||
rm -rf src/backend/langflow/frontend
|
||||
|
||||
dev:
|
||||
make install_frontend
|
||||
docker compose up --build
|
||||
|
||||
publish:
|
||||
make build
|
||||
poetry publish
|
||||
|
|
@ -49,4 +53,8 @@ help:
|
|||
@echo 'lint - run linters'
|
||||
@echo 'install_frontend - install the frontend dependencies'
|
||||
@echo 'build_frontend - build the frontend static files'
|
||||
@echo 'build - build the frontend static files and package the project'
|
||||
@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 '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
|
||||
|
||||
# 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 -
|
||||
# # Add Poetry to PATH
|
||||
ENV PATH="${PATH}:/root/.local/bin"
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@ services:
|
|||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- ./src/frontend:/app
|
||||
# Set process.env.BACKEND to the backend service
|
||||
environment:
|
||||
- BACKEND_HOST="http://backend"
|
||||
- BACKEND_PORT="7860"
|
||||
- ./src/frontend/public:/home/node/app/public
|
||||
- ./src/frontend/src:/home/node/app/src
|
||||
- ./src/frontend/package.json:/home/node/app/package.json
|
||||
restart: on-failure
|
||||
|
|
|
|||
|
|
@ -1,6 +1,13 @@
|
|||
FROM node:19-alpine as frontend_build
|
||||
ARG BACKEND
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
RUN npm install
|
||||
#baseline
|
||||
FROM node:19-alpine AS base
|
||||
RUN mkdir -p /home/node/app
|
||||
RUN chown -R node:node /home/node && chmod -R 770 /home/node
|
||||
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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue