mirror of
https://code.castopod.org/adaures/castopod
synced 2025-04-19 13:01:19 +00:00
build(devcontainer): move dev docker files to .devcontainer and set dev environment in app service
- add mailpit service to debug email - remove s3 service
This commit is contained in:
parent
9d7d11cefa
commit
13db54ccce
@ -8,9 +8,6 @@ FROM php:8.1-fpm
|
|||||||
|
|
||||||
LABEL maintainer="Yassine Doghri <yassine@doghri.fr>"
|
LABEL maintainer="Yassine Doghri <yassine@doghri.fr>"
|
||||||
|
|
||||||
COPY . /castopod
|
|
||||||
WORKDIR /castopod
|
|
||||||
|
|
||||||
# Install composer
|
# Install composer
|
||||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||||
|
|
1
.devcontainer/crontab
Normal file
1
.devcontainer/crontab
Normal file
@ -0,0 +1 @@
|
|||||||
|
* * * * * /usr/local/bin/php /workspaces/castopod/spark tasks:run >> /dev/null 2>&1
|
@ -1,13 +1,13 @@
|
|||||||
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
|
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
|
||||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.117.1/containers/docker-existing-dockerfile
|
// https://github.com/microsoft/vscode-dev-containers/tree/v0.117.1/containers/docker-existing-dockerfile
|
||||||
{
|
{
|
||||||
"name": "Castopod dev",
|
"name": "castopod.local",
|
||||||
"dockerComposeFile": ["../docker-compose.yml", "./docker-compose.yml"],
|
"dockerComposeFile": ["./docker-compose.yml"],
|
||||||
"service": "app",
|
"service": "app",
|
||||||
"workspaceFolder": "/castopod",
|
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
|
||||||
"postCreateCommand": "composer install && pnpm install && pnpm run build:static && php spark migrate --all && php spark db:seed DevSeeder",
|
"postCreateCommand": "composer install && pnpm install && pnpm run build:static && php spark migrate --all && php spark db:seed DevSeeder",
|
||||||
"postStartCommand": "crontab ./crontab && cron && php spark serve --host 0.0.0.0",
|
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder} && crontab .devcontainer/crontab && cron && php spark serve --host 0.0.0.0",
|
||||||
"postAttachCommand": "crontab ./crontab && service cron reload",
|
"postAttachCommand": "crontab .devcontainer/crontab && service cron reload",
|
||||||
"shutdownAction": "stopCompose",
|
"shutdownAction": "stopCompose",
|
||||||
"features": {
|
"features": {
|
||||||
"ghcr.io/devcontainers/features/git:1": {},
|
"ghcr.io/devcontainers/features/git:1": {},
|
||||||
|
@ -1,10 +1,84 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
volumes:
|
volumes:
|
||||||
# Mounts the project folder to '/workspace'. While this file is in .devcontainer,
|
- ../..:/workspaces:cached
|
||||||
# mounts are relative to the first file in the list, which is a level up.
|
environment:
|
||||||
- .:/castopod:cached
|
CI_ENVIRONMENT: development
|
||||||
|
vite_environment: development
|
||||||
|
app_forceGlobalSecureRequests: false
|
||||||
|
app_baseURL: http://localhost:8080/
|
||||||
|
media_baseURL: http://localhost:8080/
|
||||||
|
admin_gateway: cp-admin
|
||||||
|
auth_gateway: cp-auth
|
||||||
|
analytics_salt: dev_analytics_salt
|
||||||
|
database_default_hostname: mariadb
|
||||||
|
database_default_database: castopod
|
||||||
|
database_default_username: castopod
|
||||||
|
database_default_password: castopod
|
||||||
|
database_default_DBPrefix: cp_
|
||||||
|
restapi_enabled: true
|
||||||
|
email_fromEmail: hello@castopod.local
|
||||||
|
email_SMTPCrypto: ""
|
||||||
|
email_SMTPHost: mailpit
|
||||||
|
email_SMTPUser: castopod
|
||||||
|
email_SMTPPass: castopod
|
||||||
|
email_SMTPPort: 1025
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
- mariadb
|
||||||
|
|
||||||
# Overrides default command so things don't shut down after the process ends.
|
redis:
|
||||||
command: /bin/sh -c "while sleep 1000; do :; done"
|
image: redis:alpine
|
||||||
|
volumes:
|
||||||
|
- redis:/data
|
||||||
|
|
||||||
|
mariadb:
|
||||||
|
image: mariadb:10.2
|
||||||
|
volumes:
|
||||||
|
- ./initdb:/docker-entrypoint-initdb.d
|
||||||
|
- mariadb:/var/lib/mysql
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: root
|
||||||
|
MYSQL_DATABASE: castopod
|
||||||
|
MYSQL_USER: castopod
|
||||||
|
MYSQL_PASSWORD: castopod
|
||||||
|
|
||||||
|
phpmyadmin:
|
||||||
|
image: phpmyadmin/phpmyadmin:latest
|
||||||
|
environment:
|
||||||
|
PMA_HOST: mariadb
|
||||||
|
PMA_PORT: 3306
|
||||||
|
UPLOAD_LIMIT: 300M
|
||||||
|
ports:
|
||||||
|
- 8888:80
|
||||||
|
volumes:
|
||||||
|
- phpmyadmin:/sessions
|
||||||
|
depends_on:
|
||||||
|
- mariadb
|
||||||
|
|
||||||
|
mailpit:
|
||||||
|
image: axllent/mailpit
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- mailpit:/data
|
||||||
|
ports:
|
||||||
|
- 8025:8025
|
||||||
|
- 1025:1025
|
||||||
|
environment:
|
||||||
|
MP_MAX_MESSAGES: 5000
|
||||||
|
MP_DATA_FILE: /data/mailpit.db
|
||||||
|
MP_SMTP_AUTH_ACCEPT_ANY: 1
|
||||||
|
MP_SMTP_AUTH_ALLOW_INSECURE: 1
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
redis:
|
||||||
|
mariadb:
|
||||||
|
phpmyadmin:
|
||||||
|
mailpit:
|
||||||
|
1
crontab
1
crontab
@ -1 +0,0 @@
|
|||||||
* * * * * /usr/local/bin/php /castopod/spark tasks:run >> /dev/null 2>&1
|
|
@ -1,90 +0,0 @@
|
|||||||
version: "3.8"
|
|
||||||
|
|
||||||
networks:
|
|
||||||
castopod:
|
|
||||||
ipam:
|
|
||||||
config:
|
|
||||||
- subnet: 172.31.0.0/24
|
|
||||||
|
|
||||||
services:
|
|
||||||
app:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: docker/development/Dockerfile
|
|
||||||
container_name: app
|
|
||||||
command: /bin/sh -c "crontab ./crontab && cron && service cron reload && php spark serve --host 0.0.0.0"
|
|
||||||
ports:
|
|
||||||
- 8080:8080
|
|
||||||
volumes:
|
|
||||||
- .:/castopod
|
|
||||||
depends_on:
|
|
||||||
- redis
|
|
||||||
- mariadb
|
|
||||||
networks:
|
|
||||||
castopod:
|
|
||||||
ipv4_address: 172.31.0.2
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:alpine
|
|
||||||
container_name: castopod_redis
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
volumes:
|
|
||||||
- redis:/data
|
|
||||||
networks:
|
|
||||||
castopod:
|
|
||||||
ipv4_address: 172.31.0.3
|
|
||||||
|
|
||||||
mariadb:
|
|
||||||
image: mariadb:10.2
|
|
||||||
container_name: castopod_mariadb
|
|
||||||
ports:
|
|
||||||
- 3306:3306
|
|
||||||
volumes:
|
|
||||||
- ./initdb:/docker-entrypoint-initdb.d
|
|
||||||
- mariadb:/var/lib/mysql
|
|
||||||
environment:
|
|
||||||
MYSQL_ROOT_PASSWORD: root
|
|
||||||
MYSQL_DATABASE: castopod
|
|
||||||
MYSQL_USER: castopod
|
|
||||||
MYSQL_PASSWORD: castopod
|
|
||||||
networks:
|
|
||||||
castopod:
|
|
||||||
ipv4_address: 172.31.0.4
|
|
||||||
|
|
||||||
phpmyadmin:
|
|
||||||
image: phpmyadmin/phpmyadmin:latest
|
|
||||||
container_name: castopod_phpmyadmin
|
|
||||||
environment:
|
|
||||||
PMA_HOST: mariadb
|
|
||||||
PMA_PORT: 3306
|
|
||||||
UPLOAD_LIMIT: 300M
|
|
||||||
ports:
|
|
||||||
- 8888:80
|
|
||||||
volumes:
|
|
||||||
- phpmyadmin:/sessions
|
|
||||||
depends_on:
|
|
||||||
- mariadb
|
|
||||||
networks:
|
|
||||||
castopod:
|
|
||||||
ipv4_address: 172.31.0.5
|
|
||||||
|
|
||||||
s3:
|
|
||||||
image: adobe/s3mock:latest
|
|
||||||
container_name: castopod_s3
|
|
||||||
environment:
|
|
||||||
- initialBuckets=castopod
|
|
||||||
- debug=true
|
|
||||||
- root=/data
|
|
||||||
ports:
|
|
||||||
- 9090:9090
|
|
||||||
volumes:
|
|
||||||
- ./data/s3:/data:cached
|
|
||||||
networks:
|
|
||||||
castopod:
|
|
||||||
ipv4_address: 172.31.0.6
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
redis:
|
|
||||||
mariadb:
|
|
||||||
phpmyadmin:
|
|
Loading…
x
Reference in New Issue
Block a user