Skip to content

Commit 52b08fb

Browse files
Add dev container (#171)
* Create devcontainer.json * Create docker-compose.yml * Create .env * Create dockerfile
1 parent a840096 commit 52b08fb

4 files changed

Lines changed: 54 additions & 0 deletions

File tree

.devcontainer/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
GOTIFY_URI=http://gotify
2+
HTTPBIN_URI=http://httpbin

.devcontainer/devcontainer.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "gotify-api-php-dev-container",
3+
"dockerComposeFile": [
4+
"docker-compose.yml"
5+
],
6+
"service": "workspace",
7+
"workspaceFolder": "/gotify-api-php",
8+
"extensions": [
9+
"EditorConfig.EditorConfig",
10+
"streetsidesoftware.code-spell-checker",
11+
"bmewburn.vscode-intelephense-client",
12+
"recca0120.vscode-phpunit"
13+
],
14+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}"
15+
}

.devcontainer/docker-compose.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
services:
2+
workspace:
3+
container_name: workspace
4+
build:
5+
context: ./docker/workspace
6+
tty: true
7+
volumes:
8+
- ../:/gotify-api-php
9+
working_dir: /gotify-api-php
10+
environment:
11+
- GOTIFY_URI=${GOTIFY_URI}
12+
- HTTPBIN_URI=${HTTPBIN_URI}
13+
14+
gotify:
15+
container_name: gotify
16+
image: gotify/server:2.2.2
17+
ports:
18+
- "8080:80"
19+
environment:
20+
- GOTIFY_DEFAULTUSER_NAME=admin
21+
- GOTIFY_DEFAULTUSER_PASS=admin
22+
- GOTIFY_DATABASE_DIALECT=sqlite3
23+
- GOTIFY_DATABASE_CONNECTION=/app/gotify.db
24+
25+
httpbin:
26+
container_name: httpbin
27+
image: kennethreitz/httpbin
28+
ports:
29+
- "8081:80"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM php:8.1-alpine3.17
2+
3+
ENV COMPOSER_ALLOW_SUPERUSER 1
4+
5+
COPY --from=composer:2.5.1 /usr/bin/composer /usr/bin/composer
6+
7+
# Install packages
8+
RUN apk add --no-cache git

0 commit comments

Comments
 (0)