Skip to content

Commit f083929

Browse files
committed
initial commit
0 parents  commit f083929

File tree

14 files changed

+3638
-0
lines changed

14 files changed

+3638
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{yml,yaml}]
12+
indent_size = 2

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- directory: /.github/workflows
4+
package-ecosystem: github-actions
5+
schedule:
6+
interval: monthly

.github/workflows/ci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
PLATFORM: linux/amd64,linux/arm64
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
attestations: write
19+
strategy:
20+
matrix:
21+
php_version:
22+
- 8.2
23+
- 8.3
24+
- 8.4
25+
steps:
26+
- name: Set up QEMU
27+
uses: docker/setup-qemu-action@v3
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
with:
31+
platforms: ${{ env.PLATFORM }}
32+
33+
- name: Login to Docker Hub
34+
uses: docker/login-action@v3
35+
with:
36+
registry: ${{ env.REGISTRY }}
37+
username: ${{ github.actor }}
38+
password: ${{ github.token }}
39+
40+
- uses: actions/checkout@v4
41+
42+
- name: Extract metadata (tags, labels) for Docker
43+
id: meta
44+
uses: docker/metadata-action@v5
45+
with:
46+
labels: |
47+
org.opencontainers.image.title="php-devcontainer"
48+
org.opencontainers.image.vendor="act coding GbR"
49+
org.opencontainers.image.version="${{ matrix.php_version }}"
50+
tags: |
51+
type=raw,${{ matrix.php_version }}
52+
flavor: |
53+
latest=false
54+
55+
- name: Build and push
56+
uses: docker/build-push-action@v6
57+
id: push
58+
with:
59+
context: src
60+
file: src/Dockerfile
61+
tags: ${{ env.REGISTRY }}/${{ github.repository }}
62+
labels: ${{ steps.meta.outputs.labels }}
63+
push: ${{ github.event_name != 'pull_request' }}
64+
cache-from: type=gha
65+
cache-to: type=gha,mode=max
66+
platforms: ${{ env.PLATFORM }}
67+
build-args: |
68+
PHP_VERSION=${{ matrix.php_version }}
69+
70+
- name: Generate artifact attestation
71+
uses: actions/attest-build-provenance@v2
72+
if: github.event_name != 'pull_request'
73+
with:
74+
subject-name: ${{ env.REGISTRY }}/${{ github.repository }}
75+
subject-digest: ${{ steps.push.outputs.digest }}
76+
push-to-registry: true

src/Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
ARG PHP_VERSION
2+
3+
FROM php:${PHP_VERSION}-bookworm
4+
5+
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
6+
7+
COPY rootfs /
8+
9+
RUN apt-get update && \
10+
apt-get -y install \
11+
curl \
12+
wget \
13+
jq \
14+
git \
15+
p7zip-full \
16+
openjdk-17-jre \
17+
sudo \
18+
zsh \
19+
locales \
20+
&& \
21+
locale-gen
22+
23+
RUN install-php-extensions \
24+
xdebug \
25+
pgsql \
26+
pdo_pgsql \
27+
redis \
28+
opcache \
29+
pcntl \
30+
zip \
31+
&& \
32+
mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" && \
33+
curl -sSL https://getcomposer.org/installer | php && \
34+
chmod +x composer.phar && \
35+
mv composer.phar /usr/local/bin/composer
36+
37+
RUN groupadd -g 1001 vscode && \
38+
useradd -s /bin/zsh -m -u 1001 -g vscode vscode && \
39+
echo vscode ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/vscode && \
40+
chmod 0440 /etc/sudoers.d/vscode
41+
42+
USER vscode
43+
44+
RUN curl --proto '=https' --tlsv1.2 -LsSf https://starship.rs/install.sh | sh -s -- --yes && \
45+
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/atuinsh/atuin/releases/latest/download/atuin-installer.sh | ATUIN_NO_MODIFY_PATH=1 sh && \
46+
mv ${HOME}/.atuin/bin/* "${HOME}/bin" && \
47+
rm -rf "${HOME}/.atuin" && \
48+
mkdir -p "${HOME}/.cache" "${HOME}/.local"
49+
50+
VOLUME [ "/home/vscode/.cache", "/home/vscode/.local" ]

src/rootfs/etc/locale.gen

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
de_DE.UTF-8 UTF-8
2+
en_US.UTF-8 UTF-8
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
style = "full"
2+
inline_height = 0
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"$schema" = 'https://starship.rs/config-schema.json'
2+
3+
format = '''
4+
$directory$package$git_branch$git_status$git_state
5+
\$ '''
6+
7+
[directory]
8+
truncate_to_repo = true
9+
10+
[username]
11+
show_always = true
12+
format = '[$user]($style)'
13+
14+
[hostname]
15+
format = '[$ssh_symbol$hostname]($style)'
16+
ssh_only = false
17+
18+
[sudo]
19+
disabled = false
20+
format = '[$symbol]($style)'
21+
22+
[python]
23+
disabled = false

0 commit comments

Comments
 (0)