Skip to content

Commit a40d9b7

Browse files
committed
cd: set up new docker compose for dev and prod using frankenphp
1 parent e02d92b commit a40d9b7

File tree

533 files changed

+989
-73
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

533 files changed

+989
-73
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/cncnet-api/node_modules
2+
/cncnet-api/vendor
3+
/cncnet-api/storage/app/*
4+
/cncnet-api/storage/debugbar
5+
/cncnet-api/storage/logs
6+
.env

.env.example

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
11
# Docker related env
22
# Important for permissions, host machine user should match container as we have a volume sharing src (cncnet-api folder)
33
HOST_USER=www-data
4-
HOST_UID=1000
4+
HOST_UID=1000
5+
6+
# Mysql config
7+
MYSQL_DATABASE="cncnet_api"
8+
MYSQL_USER="cncnet"
9+
MYSQL_PASSWORD="cncnet"
10+
MYSQL_ALLOW_EMPTY_PASSWORD="false"
11+
MYSQL_ROOT_PASSWORD="yourRandomRootPass"
12+
13+
# Backups
14+
DB_TYPE="mariadb"
15+
DB_HOST="mysql"
16+
DB_NAME="cncnet_api"
17+
DB_USER="cncnet"
18+
DB_PASS="cncnet"
19+
DB_DUMP_FREQ="1440"
20+
DB_DUMP_BEGIN="0000"
21+
DB_CLEANUP_TIME="8640"
22+
CHECKSUM="SHA1"
23+
COMPRESSION="GZ"
24+
SPLIT_DB="FALSE"
25+
CONTAINER_ENABLE_MONITORING="false"
26+
MYSQL_SINGLE_TRANSACTION="true"

.github/workflows/cd.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and Deploy
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- 'main'
8+
- 'staging'
9+
tags:
10+
- 'v*'
11+
pull_request:
12+
branches:
13+
- 'main'
14+
- 'staging'
15+
16+
jobs:
17+
build-and-push:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
strategy:
23+
matrix:
24+
target: [app, queue, scheduler]
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Extract metadata (tags, labels)
30+
id: meta
31+
uses: docker/metadata-action@v5
32+
with:
33+
images: |
34+
ghcr.io/${{ github.repository_owner }}/cncnet-ladder-${{ matrix.target }}
35+
tags: |
36+
type=ref,event=branch
37+
type=ref,event=pr
38+
type=semver,pattern={{version}}
39+
type=semver,pattern={{major}}.{{minor}}
40+
type=raw,value=latest,enable={{is_default_branch}}
41+
42+
- name: Log in to GHCR
43+
uses: docker/login-action@v3
44+
with:
45+
registry: ghcr.io
46+
username: ${{ github.actor }}
47+
password: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: Build and push image (${{ matrix.target }})
50+
uses: docker/build-push-action@v6
51+
with:
52+
context: .
53+
file: ./docker/frankenphp/Dockerfile
54+
target: ${{ matrix.target }}
55+
push: ${{ github.event_name != 'pull_request' }}
56+
tags: ${{ steps.meta.outputs.tags }}
57+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,7 @@ cncnet-api/database/migrations/2022_05_14_214858_createDummyTestAccounts.php
261261

262262
**/*CreateLocalUser.php
263263
*.sql
264-
*.gz
264+
*.gz
265+
/cncnet-api/.cache/
266+
/cncnet-api/.config/
267+
/cncnet-api/.data/

cncnet-api/.bladeformatterrc.json

100644100755
File mode changed.

cncnet-api/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ public/files/maps/
88
**/debugbar/*
99
public/css/app.css
1010
public/hot
11-
storage/framework/
11+
storage/framework/
12+
/caddy
13+
frankenphp
14+
frankenphp-worker.php

cncnet-api/app/Console/Commands/AprilFoolsPurge.php

100644100755
File mode changed.

cncnet-api/app/Console/Commands/CleanupGameReports.php

100644100755
File mode changed.

cncnet-api/app/Console/Commands/CleanupQmCanceledMatches.php

100644100755
File mode changed.

cncnet-api/app/Console/Commands/CleanupQmMatchPlayers.php

100644100755
File mode changed.

0 commit comments

Comments
 (0)