Skip to content
Snippets Groups Projects
Commit 3c4cf30e authored by Matthieu Benoist's avatar Matthieu Benoist
Browse files

Adds dev environnment

parent 35f79c29
Branches
Tags 1.2.1
No related merge requests found
PROJECT_NAME=quiz
PROJECT_HOSTNAME=quiz.grandlyon.localhost
CERT_SIZE=1
...@@ -31,6 +31,7 @@ yarn-error.log ...@@ -31,6 +31,7 @@ yarn-error.log
# Miscellaneous # Miscellaneous
/.angular/cache /.angular/cache
/.env
.sass-cache/ .sass-cache/
/connect.lock /connect.lock
/coverage /coverage
......
Makefile 0 → 100644
ifneq (,$(wildcard ./.env))
include .env
endif
.PHONY: config
config:
cp .env.example .env
# Docker
up:
docker-compose up -d
down:
docker-compose down
ps:
docker-compose ps
rebuild:
docker-compose down --remove-orphans
docker-compose build --no-cache
docker-compose up -d
# Mkcert
define config_toml
[[tls.certificates]]
certFile = "/certs/${PROJECT_HOSTNAME}+${CERT_SIZE}.pem"
keyFile = "/certs/${PROJECT_HOSTNAME}+${CERT_SIZE}-key.pem"
endef
export config_toml
npm-install: docker compose run --rm node npm install
certs:
mkdir -p ${HOME}/.dockerdev/traefik/certs ${HOME}/.dockerdev/traefik/conf
mkcert ${PROJECT_HOSTNAME} *.${PROJECT_HOSTNAME} ${CERT_ALIASES}
mv *.pem ~/.dockerdev/traefik/certs
@echo "$$config_toml" > ~/.dockerdev/traefik/conf/${PROJECT_NAME}-certs.toml
install: config certs up
services:
node:
image: trion/ng-cli:17.2.1
restart: unless-stopped
volumes:
- ./:/app
working_dir: /app
command: ng serve --host 0.0.0.0 --port 4200
networks:
- webgateway
labels:
- "traefik.enable=true"
- "traefik.http.routers.${PROJECT_NAME}-front.rule=Host(`${PROJECT_HOSTNAME}`)"
- "traefik.http.routers.${PROJECT_NAME}-front.tls=true"
- "traefik.http.routers.${PROJECT_NAME}-front.entrypoints=websecure"
- "traefik.http.services.${PROJECT_NAME}-front.loadbalancer.server.port=4200"
- "traefik.http.services.${PROJECT_NAME}-nginx.loadbalancer.server.port=8080"
networks:
webgateway:
external: true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment