diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b1c349f..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -Makefile.linux diff --git a/Makefile b/Makefile index 4d560b1..3617e42 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,12 @@ NAME = transcendence USER = gavaniwast -CERT = volumes/ssl/$(NAME).pem - all: clean start -$(CERT): - openssl req -newkey rsa:4096 -x509 -sha256 -days 365 -nodes \ - -out $(NAME).pem -keyout $(NAME).pem \ - -subj "/C=FR/ST=Nice/L=Nice/O=42/OU=student/CN=$(NAME)_$(USER)/" - mkdir -p volumes/ssl - mv $(NAME).pem volumes/ssl - -start: $(CERT) +start: BACK_RUN=start docker compose -f docker-compose.yml up --build -debug: $(CERT) +debug: BUILDKIT_PROGRESS=plain BACK_RUN=start:debug docker compose -f docker-compose.yml up --build stop: @@ -25,6 +16,7 @@ clean: stop docker system prune -f fclean: stop + rm -rf volumes/*/node_modules docker system prune -af --volumes re: fclean start diff --git a/Makesudo b/Makesudo new file mode 100644 index 0000000..18bdbc0 --- /dev/null +++ b/Makesudo @@ -0,0 +1,22 @@ +NAME = transcendence +USER = gavaniwast + +all: clean start + +start: + sudo BACK_RUN=start docker compose -f docker-compose.yml up --build + +debug: + sudo BUILDKIT_PROGRESS=plain BACK_RUN=start:debug docker compose -f docker-compose.yml up --build + +stop: + sudo docker compose -f docker-compose.yml down + +clean: stop + sudo docker system prune -f + +fclean: stop + rm -rf volumes/*/node_modules + sudo docker system prune -af --volumes + +re: fclean start diff --git a/cont/back/Dockerfile b/back/Dockerfile similarity index 100% rename from cont/back/Dockerfile rename to back/Dockerfile diff --git a/volumes/back/.gitignore b/back/volume/.gitignore similarity index 100% rename from volumes/back/.gitignore rename to back/volume/.gitignore diff --git a/volumes/back/README.md b/back/volume/README.md similarity index 100% rename from volumes/back/README.md rename to back/volume/README.md diff --git a/volumes/back/nest-cli.json b/back/volume/nest-cli.json similarity index 100% rename from volumes/back/nest-cli.json rename to back/volume/nest-cli.json diff --git a/volumes/back/package-lock.json b/back/volume/package-lock.json similarity index 100% rename from volumes/back/package-lock.json rename to back/volume/package-lock.json diff --git a/volumes/back/package.json b/back/volume/package.json similarity index 100% rename from volumes/back/package.json rename to back/volume/package.json diff --git a/volumes/back/src/app.module.ts b/back/volume/src/app.module.ts similarity index 100% rename from volumes/back/src/app.module.ts rename to back/volume/src/app.module.ts diff --git a/volumes/back/src/main.ts b/back/volume/src/main.ts similarity index 100% rename from volumes/back/src/main.ts rename to back/volume/src/main.ts diff --git a/volumes/back/src/pong/game/Ball.ts b/back/volume/src/pong/game/Ball.ts similarity index 100% rename from volumes/back/src/pong/game/Ball.ts rename to back/volume/src/pong/game/Ball.ts diff --git a/volumes/back/src/pong/game/Game.ts b/back/volume/src/pong/game/Game.ts similarity index 100% rename from volumes/back/src/pong/game/Game.ts rename to back/volume/src/pong/game/Game.ts diff --git a/volumes/back/src/pong/game/Paddle.ts b/back/volume/src/pong/game/Paddle.ts similarity index 100% rename from volumes/back/src/pong/game/Paddle.ts rename to back/volume/src/pong/game/Paddle.ts diff --git a/volumes/back/src/pong/game/Player.ts b/back/volume/src/pong/game/Player.ts similarity index 100% rename from volumes/back/src/pong/game/Player.ts rename to back/volume/src/pong/game/Player.ts diff --git a/volumes/back/src/pong/game/constants.ts b/back/volume/src/pong/game/constants.ts similarity index 100% rename from volumes/back/src/pong/game/constants.ts rename to back/volume/src/pong/game/constants.ts diff --git a/volumes/back/src/pong/game/utils.ts b/back/volume/src/pong/game/utils.ts similarity index 100% rename from volumes/back/src/pong/game/utils.ts rename to back/volume/src/pong/game/utils.ts diff --git a/volumes/back/src/pong/pong.gateway.spec.ts b/back/volume/src/pong/pong.gateway.spec.ts similarity index 100% rename from volumes/back/src/pong/pong.gateway.spec.ts rename to back/volume/src/pong/pong.gateway.spec.ts diff --git a/volumes/back/src/pong/pong.gateway.ts b/back/volume/src/pong/pong.gateway.ts similarity index 100% rename from volumes/back/src/pong/pong.gateway.ts rename to back/volume/src/pong/pong.gateway.ts diff --git a/volumes/back/src/pong/pong.module.ts b/back/volume/src/pong/pong.module.ts similarity index 100% rename from volumes/back/src/pong/pong.module.ts rename to back/volume/src/pong/pong.module.ts diff --git a/volumes/back/src/pong/pong.spec.ts b/back/volume/src/pong/pong.spec.ts similarity index 100% rename from volumes/back/src/pong/pong.spec.ts rename to back/volume/src/pong/pong.spec.ts diff --git a/volumes/back/src/pong/pong.ts b/back/volume/src/pong/pong.ts similarity index 100% rename from volumes/back/src/pong/pong.ts rename to back/volume/src/pong/pong.ts diff --git a/volumes/back/test/app.e2e-spec.ts b/back/volume/test/app.e2e-spec.ts similarity index 100% rename from volumes/back/test/app.e2e-spec.ts rename to back/volume/test/app.e2e-spec.ts diff --git a/volumes/back/test/jest-e2e.json b/back/volume/test/jest-e2e.json similarity index 100% rename from volumes/back/test/jest-e2e.json rename to back/volume/test/jest-e2e.json diff --git a/volumes/back/tsconfig.build.json b/back/volume/tsconfig.build.json similarity index 100% rename from volumes/back/tsconfig.build.json rename to back/volume/tsconfig.build.json diff --git a/volumes/back/tsconfig.json b/back/volume/tsconfig.json similarity index 100% rename from volumes/back/tsconfig.json rename to back/volume/tsconfig.json diff --git a/docker-compose.yml b/docker-compose.yml index db811af..50f5205 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,23 +6,23 @@ networks: services: front: container_name: front - build: cont/front/ + build: front/ env_file: .env depends_on: [postgres, back] ports: [80:80] - volumes: [./volumes/front:/var/www/html] + volumes: [./front/volume:/var/www/html] networks: [transcendence] restart: always back: container_name: back - build: cont/back/ + build: back/ env_file: .env environment: - RUN=${BACK_RUN} depends_on: [postgres] ports: [3001:3001] networks: [transcendence] - volumes: [./volumes/back:/var/www/html] + volumes: [./back/volume:/var/www/html] restart: always postgres: container_name: postgres diff --git a/cont/front/Dockerfile b/front/Dockerfile similarity index 100% rename from cont/front/Dockerfile rename to front/Dockerfile diff --git a/volumes/front/.gitignore b/front/volume/.gitignore similarity index 100% rename from volumes/front/.gitignore rename to front/volume/.gitignore diff --git a/volumes/front/README.md b/front/volume/README.md similarity index 100% rename from volumes/front/README.md rename to front/volume/README.md diff --git a/volumes/front/index.html b/front/volume/index.html similarity index 100% rename from volumes/front/index.html rename to front/volume/index.html diff --git a/volumes/front/package-lock.json b/front/volume/package-lock.json similarity index 100% rename from volumes/front/package-lock.json rename to front/volume/package-lock.json diff --git a/volumes/front/package.json b/front/volume/package.json similarity index 100% rename from volumes/front/package.json rename to front/volume/package.json diff --git a/volumes/front/public/global.css b/front/volume/public/global.css similarity index 100% rename from volumes/front/public/global.css rename to front/volume/public/global.css diff --git a/volumes/front/public/img/pog.jpg b/front/volume/public/img/pog.jpg similarity index 100% rename from volumes/front/public/img/pog.jpg rename to front/volume/public/img/pog.jpg diff --git a/volumes/front/public/img/pong.png b/front/volume/public/img/pong.png similarity index 100% rename from volumes/front/public/img/pong.png rename to front/volume/public/img/pong.png diff --git a/volumes/front/public/img/profileicon.png b/front/volume/public/img/profileicon.png similarity index 100% rename from volumes/front/public/img/profileicon.png rename to front/volume/public/img/profileicon.png diff --git a/volumes/front/public/vite.svg b/front/volume/public/vite.svg similarity index 100% rename from volumes/front/public/vite.svg rename to front/volume/public/vite.svg diff --git a/volumes/front/src/App.svelte b/front/volume/src/App.svelte similarity index 100% rename from volumes/front/src/App.svelte rename to front/volume/src/App.svelte diff --git a/volumes/front/src/app.d.ts b/front/volume/src/app.d.ts similarity index 100% rename from volumes/front/src/app.d.ts rename to front/volume/src/app.d.ts diff --git a/volumes/front/src/assets/svelte.svg b/front/volume/src/assets/svelte.svg similarity index 100% rename from volumes/front/src/assets/svelte.svg rename to front/volume/src/assets/svelte.svg diff --git a/volumes/front/src/components/Friends.svelte b/front/volume/src/components/Friends.svelte similarity index 100% rename from volumes/front/src/components/Friends.svelte rename to front/volume/src/components/Friends.svelte diff --git a/volumes/front/src/components/MatchHistory.svelte b/front/volume/src/components/MatchHistory.svelte similarity index 100% rename from volumes/front/src/components/MatchHistory.svelte rename to front/volume/src/components/MatchHistory.svelte diff --git a/volumes/front/src/components/NavBar.svelte b/front/volume/src/components/NavBar.svelte similarity index 100% rename from volumes/front/src/components/NavBar.svelte rename to front/volume/src/components/NavBar.svelte diff --git a/volumes/front/src/components/Play.svelte b/front/volume/src/components/Play.svelte similarity index 100% rename from volumes/front/src/components/Play.svelte rename to front/volume/src/components/Play.svelte diff --git a/volumes/front/src/components/Pong/Ball.ts b/front/volume/src/components/Pong/Ball.ts similarity index 100% rename from volumes/front/src/components/Pong/Ball.ts rename to front/volume/src/components/Pong/Ball.ts diff --git a/volumes/front/src/components/Pong/Game.ts b/front/volume/src/components/Pong/Game.ts similarity index 100% rename from volumes/front/src/components/Pong/Game.ts rename to front/volume/src/components/Pong/Game.ts diff --git a/volumes/front/src/components/Pong/Paddle.ts b/front/volume/src/components/Pong/Paddle.ts similarity index 100% rename from volumes/front/src/components/Pong/Paddle.ts rename to front/volume/src/components/Pong/Paddle.ts diff --git a/volumes/front/src/components/Pong/Player.ts b/front/volume/src/components/Pong/Player.ts similarity index 100% rename from volumes/front/src/components/Pong/Player.ts rename to front/volume/src/components/Pong/Player.ts diff --git a/volumes/front/src/components/Pong/Pong.svelte b/front/volume/src/components/Pong/Pong.svelte similarity index 100% rename from volumes/front/src/components/Pong/Pong.svelte rename to front/volume/src/components/Pong/Pong.svelte diff --git a/volumes/front/src/components/Pong/constants.ts b/front/volume/src/components/Pong/constants.ts similarity index 100% rename from volumes/front/src/components/Pong/constants.ts rename to front/volume/src/components/Pong/constants.ts diff --git a/volumes/front/src/components/Pong/utils.ts b/front/volume/src/components/Pong/utils.ts similarity index 100% rename from volumes/front/src/components/Pong/utils.ts rename to front/volume/src/components/Pong/utils.ts diff --git a/volumes/front/src/components/Profile.svelte b/front/volume/src/components/Profile.svelte similarity index 100% rename from volumes/front/src/components/Profile.svelte rename to front/volume/src/components/Profile.svelte diff --git a/volumes/front/src/components/Spectate.svelte b/front/volume/src/components/Spectate.svelte similarity index 100% rename from volumes/front/src/components/Spectate.svelte rename to front/volume/src/components/Spectate.svelte diff --git a/volumes/front/src/main.ts b/front/volume/src/main.ts similarity index 100% rename from volumes/front/src/main.ts rename to front/volume/src/main.ts diff --git a/volumes/front/src/vite-env.d.ts b/front/volume/src/vite-env.d.ts similarity index 100% rename from volumes/front/src/vite-env.d.ts rename to front/volume/src/vite-env.d.ts diff --git a/volumes/front/svelte.config.js b/front/volume/svelte.config.js similarity index 100% rename from volumes/front/svelte.config.js rename to front/volume/svelte.config.js diff --git a/volumes/front/tsconfig.json b/front/volume/tsconfig.json similarity index 100% rename from volumes/front/tsconfig.json rename to front/volume/tsconfig.json diff --git a/volumes/front/tsconfig.node.json b/front/volume/tsconfig.node.json similarity index 100% rename from volumes/front/tsconfig.node.json rename to front/volume/tsconfig.node.json diff --git a/volumes/front/vite.config.ts b/front/volume/vite.config.ts similarity index 100% rename from volumes/front/vite.config.ts rename to front/volume/vite.config.ts