diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..20b13a7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +# Avoid sending secrets or dev tooling into the build context +# config/ and plugins/ are included (no secrets; PHP configs read from ENV at runtime) +node_modules +.git +.prettierrc +.prettierignore +*.md +.env +.env.* diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..048d79a --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.env +.env.* +!.env.example + +node_modules +pnpm-lock.yaml diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..ee89780 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +node_modules +pnpm-lock.yaml diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..85b0780 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,15 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "overrides": [ + { + "files": "*.yml", + "options": { + "tabWidth": 4, + "proseWrap": "preserve" + } + } + ] +} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..675a1ed --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM nginx:alpine + +COPY nginx/conf.d/ /etc/nginx/conf.d/ +COPY src/ /usr/share/nginx/html/ diff --git a/README.md b/README.md index e69de29..604ebda 100644 --- a/README.md +++ b/README.md @@ -0,0 +1 @@ +# Simple Package (Docker) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b717932 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,34 @@ +services: + service: + image: git.mifi.dev/...:${IMAGE_TAG:-latest} + container_name: service + environment: + - ENV_NAME=value + healthcheck: + test: + [ + 'CMD', + '/usr/local/bin/healthcheck.sh', + '--connect', + '--innodb_initialized' + ] + retries: 10 + start_period: 20s + networks: + - network + volumes: + - volume:/var/lib/... + - other_volume:/var/lib/... + depends_on: + - other service + restart: unless-stopped + +networks: + network: + external: true + +volumes: + volume: + external: true + other_volume: + external: false \ No newline at end of file diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf new file mode 100644 index 0000000..af6f8b0 --- /dev/null +++ b/nginx/conf.d/default.conf @@ -0,0 +1,40 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + + # HTML: revalidate so content updates are seen quickly + location ~* \.html?$ { + add_header Cache-Control "public, no-cache"; + try_files $uri $uri/ =404; + } + + # Versioned/hashed assets: long cache, immutable + location ~* \.(js|css)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + try_files $uri =404; + } + + # Images and media + location ~* \.(ico|png|jpg|jpeg|gif|webp|svg|avif)$ { + expires 30d; + add_header Cache-Control "public"; + try_files $uri =404; + } + + # Fonts + location ~* \.(woff2?|ttf|otf|eot)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + try_files $uri =404; + } + + # Default: serve static files, then try directory/index, then 404 + location / { + add_header Cache-Control "public, no-cache"; + try_files $uri $uri/ /index.html =404; + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..e12d6bc --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "...", + "version": "1.0.0", + "private": true, + "packageManager": "pnpm@10.29.3", + "scripts": { + "format": "prettier --write .", + "format:check": "prettier --check .", + "lint": "yamllint .woodpecker/ci.yml .woodpecker/build.yml .woodpecker/deploy.yml docker-compose.yml", + "docker:build": "docker build --platform linux/amd64 -t git.mifi.dev/.../...:latest .", + "docker:push": "docker push git.mifi.dev/.../...:latest" + }, + "devDependencies": { + "prettier": "^3.4.2", + "yaml-lint": "^1.7.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/.../...git" + } +}