diff --git a/Dockerfile.fastapi b/Dockerfile.fastapi index 37a41c2..f435100 100644 --- a/Dockerfile.fastapi +++ b/Dockerfile.fastapi @@ -1,16 +1,20 @@ -FROM python:3.12-slim +FROM eswardudi/python-ffmpeg:3.13.3 WORKDIR /app -COPY server/py/fastapi_server/requirements.txt ./ -RUN pip install --no-cache-dir r requirements.txt +COPY server/py/fastapi_server/requirements_prod.txt ./ +RUN pip install --no-cache-dir -r requirements_prod.txt # This one is necessary for the server -RUN apt install ffmpeg -y +#RUN apt update && apt install ffmpeg -y -COPY server/py/fastapi_server/ ./ +#COPY server/py/fastapi_server/ ./ +COPY ./server/py/fastapi_server/*.py ./ -ENV PORT=3000 +ENV PORT=8000 ENV HOST=0.0.0.0 +ENV DOWNLOAD_FOLDER=/tmp/downloads -CMD ["fastapi","run","main.py"] +VOLUME ["/tmp/downloads"] + +CMD ["python3", "main.py"] diff --git a/Dockerfile.nuxt b/Dockerfile.nuxt index fb4467e..cbfd5e6 100644 --- a/Dockerfile.nuxt +++ b/Dockerfile.nuxt @@ -1,6 +1,8 @@ FROM node:22-alpine AS build WORKDIR /app +RUN sysctl -w net.ipv6.conf.all.disable_ipv6=1 || true + RUN corepack enable COPY . /app/ @@ -10,14 +12,20 @@ RUN pnpm i RUN pnpm build FROM node:22-alpine +WORKDIR /app # Only `.output` folder is needed from the build stage COPY --from=build /app/.output/ ./ # Change the port and host -ENV PORT=80 +ENV PORT=3000 ENV HOST=0.0.0.0 -EXPOSE 80 +EXPOSE 3000 + +ENV DOWNLOAD_FOLDER=/tmp/downloads +VOLUME ["/tmp/downloads"] + +ENV FASTAPI_URL=http://127.0.0.1:8000 CMD ["node", "/app/server/index.mjs"] \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 77af7ed..433ea6e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,3 +1,34 @@ -services: +volumes: + music_downloads: {} +networks: + api_nuxt: + driver: "bridge" +services: + fastapi: + build: + context: . + dockerfile: Dockerfile.fastapi + networks: + - api_nuxt + volumes: + - music_downloads:/tmp/downloads + + nuxt: + #build: + # context: . + # dockerfile: Dockerfile.nuxt + image: nuxtjs-launcher + networks: + - api_nuxt + ports: + - "64002:3030" # just for the admin GUI + - "6903:3000" + environment: + - FASTAPI_URL=http://fastapi:8000 + - DOWNLOAD_FOLDER=/tmp/downloads + volumes: + - music_downloads:/tmp/downloads + - ./:/app + \ No newline at end of file