diff --git a/Dockerfile b/Dockerfile index c7229ee..09c2b76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,24 @@ FROM node:18-alpine -# Create app directory and set permissions -WORKDIR /home/node/app +WORKDIR /app + +# Install build dependencies +RUN apk add --no-cache python3 make g++ + +# Copy package files +COPY package*.json ./ # Install dependencies -COPY package*.json ./ RUN npm install -# Copy app source +# Copy source code COPY . . -# Create directories with proper permissions -RUN mkdir -p /home/node/app/data /home/node/app/public/uploads && \ - chown -R node:node /home/node/app && \ - chmod -R 777 /home/node/app/data /home/node/app/public/uploads - -# Switch to non-root user -USER node +# Build CSS +RUN npm run build:css # Expose port EXPOSE 2222 # Start the application -CMD ["node", "server.js"] \ No newline at end of file +CMD ["npm", "start"] \ No newline at end of file diff --git a/package.json b/package.json index 55393c2..c8e663b 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "node server.js", "dev": "nodemon server.js", - "build:css": "tailwindcss -i ./src/styles.css -o ./public/css/styles.css --watch" + "build:css": "tailwindcss -i ./public/css/styles.css -o ./public/css/dist/styles.css --minify" }, "dependencies": { "bcrypt": "^5.1.1", @@ -19,12 +19,13 @@ "multer": "^1.4.5-lts.1", "sqlite3": "^5.1.7", "uuid": "^9.0.1", - "winston": "^3.11.0" + "winston": "^3.11.0", + "tailwindcss": "^3.3.5", + "autoprefixer": "^10.4.16", + "postcss": "^8.4.31", + "postcss-cli": "^10.1.0" }, "devDependencies": { - "autoprefixer": "^10.4.16", - "nodemon": "^3.0.3", - "postcss": "^8.4.31", - "tailwindcss": "^3.3.5" + "nodemon": "^3.0.3" } } \ No newline at end of file diff --git a/public/index.html b/public/index.html index bd43842..3504cfa 100644 --- a/public/index.html +++ b/public/index.html @@ -4,128 +4,11 @@