feat: add Dockerfile and .dockerignore, refactor backend to use DATA_DIR for database and uploads
Now able to use docker image
This commit is contained in:
1 parent
3d9f7d2052
commit
9c61bf2e2c
4 files changed
+60
-18
No files matched your search
+26
@@ -0,0 +1,26 @@
|
||||
# Build frontend
|
||||
FROM node:24-alpine AS frontend
|
||||
WORKDIR /app/frontend
|
||||
COPY frontend/package*.json ./
|
||||
RUN npm install
|
||||
COPY frontend ./
|
||||
RUN npm run build
|
||||
|
||||
# Build backend
|
||||
FROM node:24-alpine AS backend
|
||||
WORKDIR /app
|
||||
COPY backend/package*.json ./backend/
|
||||
COPY backend/ ./backend/
|
||||
RUN cd backend && npm install
|
||||
|
||||
RUN mkdir -p /data/uploads && chmod -R 777 /data
|
||||
|
||||
# Copy built frontend into backend
|
||||
COPY --from=frontend /app/frontend/dist ./frontend/dist
|
||||
|
||||
WORKDIR /app/backend
|
||||
EXPOSE 3000
|
||||
|
||||
ENV DATA_DIR=/data
|
||||
|
||||
CMD ["node", "index.js"]
|
||||
Reference in new issue
Block a user