mirror of
https://github.com/filecoffee/filehost.git
synced 2024-11-13 19:49:56 +01:00
docker support
This commit is contained in:
parent
6d1c22bd31
commit
737f5d9eaf
4 changed files with 22 additions and 1 deletions
8
Dockerfile
Normal file
8
Dockerfile
Normal 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
13
docker-compose.yml
Normal 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
|
2
index.js
2
index.js
|
@ -4,7 +4,7 @@ const ejs = require("ejs");
|
||||||
const fileRoutes = require("./routes/file.routes");
|
const fileRoutes = require("./routes/file.routes");
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = process.env.PORT || 3000;
|
const port = 3000;
|
||||||
const apiKeys = process.env.API_KEYS.split(",");
|
const apiKeys = process.env.API_KEYS.split(",");
|
||||||
const allowPublicUploads = process.env.ALLOW_PUBLIC_UPLOADS === "true";
|
const allowPublicUploads = process.env.ALLOW_PUBLIC_UPLOADS === "true";
|
||||||
const hosterEmail = process.env.HOSTER_EMAIL;
|
const hosterEmail = process.env.HOSTER_EMAIL;
|
||||||
|
|
Loading…
Reference in a new issue