Natthathida's picture
Update Dockerfile
3f3f57b verified
raw
history blame
2.94 kB
FROM node:20-alpine AS builder
RUN apk add --no-cache libc6-compat
WORKDIR /app
# Install dependencies based on the preferred package manager
COPY frontend .
RUN npm i
RUN npm run build
RUN ls -al
FROM python:3.10-slim AS backend
RUN useradd -m -u 1000 user
USER user
WORKDIR /app
RUN chown -R user:user /code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
COPY --chown=user:user . /code
EXPOSE 5000
WORKDIR /app
COPY --from=builder /app/build ./static
COPY . .
# RUN mkdir -p /app/cache/hub/models--suno--bark/snapshots/70a8a7d34168586dc5d028fa9666aceade177992
# RUN mkdir -p /app/cache/hub/models--suno--bark/blobs
# RUN mkdir -p /app/cache/hub/models--suno--bark/refs/main
# RUN mkdir -p /app/cache/hub/hub/models--suno--bark/blobs
# RUN mkdir -p /app/cache/hub/hub/models--suno--bark/snapshots/70a8a7d34168586dc5d028fa9666aceade177992
# RUN mkdir -p /app/cache/hub/hub/models--suno--bark/refs/main
# RUN mkdir -p /app/cache/hub/hub/hub/models--suno--bark/blobs
# RUN mkdir -p /app/cache/hub/hub/hub/models--suno--bark/snapshots/70a8a7d34168586dc5d028fa9666aceade177992
# RUN mkdir -p /app/cache/hub/hub/hub/models--suno--bark/refs/main
# # ตั้งค่าสิทธิ์ในไดเรกทอรี snapshots
# RUN find /app/cache/hub/models--suno--bark/snapshots -type f -exec chmod u+rw {} \; \
# && find /app/cache/hub/models--suno--bark/snapshots -type d -exec chmod u+rwx {} \;
# # ตั้งค่าสิทธิ์ในไดเรกทอรี blobs
# RUN find /app/cache/hub/models--suno--bark/blobs -type f -exec chmod u+rw {} \; \
# && find /app/cache/hub/models--suno--bark/blobs -type d -exec chmod u+rwx {} \;
# # ตั้งค่าสิทธิ์ในไดเรกทอรี refs/main
# RUN find /app/cache/hub/models--suno--bark/refs/main -type f -exec chmod u+rw {} \; \
# && find /app/cache/hub/models--suno--bark/refs/main -type d -exec chmod u+rwx {} \;
# # ตั้งค่าสิทธิ์ในไดเรกทอรี refs/main
# RUN find /app/cache/hub/hub/models--suno--bark/refs/main -type f -exec chmod u+rw {} \; \
# && find /app/cache/hub/hub/models--suno--bark/refs/main -type d -exec chmod u+rwx {} \;
# # ตั้งค่าสิทธิ์ในไดเรกทอรี refs/main
# RUN find /app/cache/hub/hub/hub/models--suno--bark/refs/main -type f -exec chmod u+rw {} \; \
# && find /app/cache/hub/hub/hub/models--suno--bark/refs/main -type d -exec chmod u+rwx {} \;
RUN chmod -R u+rwX /app/cache/hub
# RUN chmod -R u+rwX /app/cache/hub/hub
# RUN chmod -R u+rwX /app/cache/hub/hub/hub
RUN ls -al /app/cache/hub/
# RUN ls -al /app/cache/hub/hub/hub/
# RUN ls -al /app/cache/hub/hub/models--suno--bark/refs/
ENV HF_HOME=/app/cache/hub/
# ENV HF_HOME=/app/cache/hub/hub
# ENV HF_HOME=/app/cache/hub/hub/hub
CMD ["python", "app.py"]