diff --git a/.dockerignore copy b/.dockerignore copy new file mode 100644 index 000000000..5e6db7247 --- /dev/null +++ b/.dockerignore copy @@ -0,0 +1,6 @@ +node_modules +Dockerfile +npm-debug.log +.git +.gitignore +*.db \ No newline at end of file diff --git a/.github/workflows/push_to_mirror.yml b/.github/workflows/push_to_mirror.yml new file mode 100644 index 000000000..813ff8f57 --- /dev/null +++ b/.github/workflows/push_to_mirror.yml @@ -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 }} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..9bfe41628 --- /dev/null +++ b/docker-compose.yml @@ -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: \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 000000000..5d9b01efd --- /dev/null +++ b/dockerfile @@ -0,0 +1,13 @@ +FROM node:20-alpine + +WORKDIR /usr/src/app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +EXPOSE 3000 + +CMD ["npm", "start"] \ No newline at end of file diff --git a/package copy.json b/package copy.json new file mode 100644 index 000000000..b84214f7b --- /dev/null +++ b/package copy.json @@ -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" + } +} \ No newline at end of file