docker support

This commit is contained in:
Daniël 2024-06-04 19:16:19 +02:00
parent 6d1c22bd31
commit 737f5d9eaf
4 changed files with 22 additions and 1 deletions

8
Dockerfile Normal file
View file

@ -0,0 +1,8 @@
FROM node:20
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["node", "index.js"]

13
docker-compose.yml Normal file
View file

@ -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

View file

@ -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;

View file