Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
npm-debug.log
Dockerfile
.dockerignore
.git
.gitignore
docker-compose.yml
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:24-alpine

# Create app user and group
RUN addgroup app && adduser -S -G app app

WORKDIR /usr/src/app

# Copy package files and install dependencies as root
COPY package*.json ./
RUN npm ci --omit=dev

# Copy rest of the app
COPY . .

# Switch to non-root user for runtime
USER app

EXPOSE 3000
CMD ["node", "app.js"]
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var express = require('express');

var app = express();

app.set('port', process.env.PORT || 3005); // GİRİŞ PORTU AYARLANDI
app.set('port', process.env.PORT || 3000); // GİRİŞ PORTU AYARLANDI
app.set('views', __dirname + '/app/server/views'); // VIEW KLASÖRÜ TANITILDI
app.set('view engine', 'ejs'); // VIEW ENGINE AYARLANDI
app.use(express.static(__dirname + '/app/public')); // KULLANICILAR TARAFINDAN ERİŞİLEBİLEN KLASÖR TANIMLANDI
Expand Down
14 changes: 4 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
version: '3.7'

services:
environment:
container_name: environment
app:
container_name: app
build:
context: .
dockerfile: dockerfile
dockerfile: Dockerfile
ports:
- 3005:3005
stdin_open: true
environment:
- CHOKIDAR_USEPOLLING=true
command: node app.js
- "3000:3000"
8 changes: 0 additions & 8 deletions dockerfile

This file was deleted.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"description": "Sample Node.js Project",
"main": "app.js",
"scripts": {
"start": "node app.js",
"test": "echo \"Error: no test specified\" && exit 1",
"build": "echo 'Building the project...' && exit 0" // Replace this with your actual build command
"start": "node app.js"
},
"author": "Adem Cemil YALCIN",
"license": "ISC",
Expand Down