Convert to dockerized repo
This commit is contained in:
9
.dockerignore
Normal file
9
.dockerignore
Normal file
@@ -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.*
|
||||||
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
pnpm-lock.yaml
|
||||||
2
.prettierignore
Normal file
2
.prettierignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
pnpm-lock.yaml
|
||||||
15
.prettierrc
Normal file
15
.prettierrc
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"semi": false,
|
||||||
|
"singleQuote": true,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": "*.yml",
|
||||||
|
"options": {
|
||||||
|
"tabWidth": 4,
|
||||||
|
"proseWrap": "preserve"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
4
Dockerfile
Normal file
4
Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
COPY nginx/conf.d/ /etc/nginx/conf.d/
|
||||||
|
COPY src/ /usr/share/nginx/html/
|
||||||
34
docker-compose.yml
Normal file
34
docker-compose.yml
Normal file
@@ -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
|
||||||
40
nginx/conf.d/default.conf
Normal file
40
nginx/conf.d/default.conf
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
21
package.json
Normal file
21
package.json
Normal file
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user