Skip to content
Closed
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
6 changes: 6 additions & 0 deletions .dockerignore copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
Dockerfile
npm-debug.log
.git
.gitignore
*.db
20 changes: 20 additions & 0 deletions .github/workflows/push_to_mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: push_to_mirror

on:
push:
branches:
- 'main'

jobs:
push_to_epitech_repository:
runs-on: ubuntu-latest
steps:
- name: Get repository content
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push to Epitech repository
uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url: ${{ secrets.EPITECH_REPOSITORY_URL }}
ssh_private_key: ${{ secrets.EPITECH_REPOSITORY_KEY }}
35 changes: 35 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '3.8'

services:
app:
build: .
ports:
- "3000:3000"
environment:
- MYSQL_HOST=db
- MYSQL_USER=todo_user
- MYSQL_PASSWORD=todo_password
- MYSQL_DB=todo_db
depends_on:
db:
condition: service_healthy

db:
image: mysql:8.0
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=root_password
- MYSQL_DATABASE=todo_db
- MYSQL_USER=todo_user
- MYSQL_PASSWORD=todo_password
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5

volumes:
db_data:
13 changes: 13 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20-alpine

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 3000

CMD ["npm", "start"]
29 changes: 29 additions & 0 deletions package copy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "101-app",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"start": "node src/index.js",
"dev": "nodemon -L src/index.js"
},
"dependencies": {
"express": "^5.2.1",
"mysql2": "^3.16.1",
"sqlite3": "^5.1.7",
"uuid": "^13.0.0",
"wait-port": "^1.1.0"
},
"devDependencies": {
"nodemon": "^3.1.9"
},
"overrides": {
"tar": "7.5.4",
"glob": "11.1.0",
"semver": "7.5.2",
"cross-spawn": "7.0.5",
"braces": "3.0.3",
"http-cache-semantics": "4.1.1",
"socks": "2.8.1"
}
}