diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dfcbe86 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM node:20 +WORKDIR /usr/src/app +COPY package*.json ./ +RUN npm install +COPY . . +EXPOSE 3000 + +CMD ["node", "index.js"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d75f7f9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +services: + app: + container_name: filehost + build: . + ports: + - "${PORT}:${PORT}" + volumes: + - .:/usr/src/app + - ./uploads:/usr/src/app/uploads + env_file: + - .env + environment: + NODE_ENV: development diff --git a/index.js b/index.js index afcf9f9..ed8f616 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ const ejs = require("ejs"); const fileRoutes = require("./routes/file.routes"); const app = express(); -const port = process.env.PORT || 3000; +const port = 3000; const apiKeys = process.env.API_KEYS.split(","); const allowPublicUploads = process.env.ALLOW_PUBLIC_UPLOADS === "true"; const hosterEmail = process.env.HOSTER_EMAIL; diff --git a/src/app.js b/src/app.js deleted file mode 100644 index e69de29..0000000