Files
Umbraco-CMS/templates/UmbracoDockerCompose/docker-compose.yml

103 lines
3.1 KiB
YAML
Raw Normal View History

Improve dotnet templates (#16815) * Add delivery api toggle * Add Dockerfile * add docker compose template * Ensure no duplicate database containers * Remove wwwroot/umbraco permission check We don't need write access to this folder * Provide environment variables from dokcer-compose * Build as debug from compose The compose file is intended to be used for local dev * Don't store password in docker files Still not great to store it in .env but it's fine for dev * Add additional template files * Add docker ignore file * Enable delivery API in settings too * Enable models builder mode toggle * Add WIP for umbraco release option * Add starterkit option * Add option to chose LTS or latest * Add development mode option * Add descriptions * Add display names * Add backoffice development at explicit default * Rearrange DevelopmentMode before ModelsBuilderMode * Allow specifying a port for the compose file * Add some notes * Move starterkits into its own template * Don't update version * Remove test configuration from Dockerfile * Add default modelsbuilder option * Update descriptions * overwrite default values in IDE development * Remove obsolete runtime minification * Try and fix healthcheck * Don't use post action for starterkit otherwise it won't work with Rider, also make the version 13.0.0 if LTS is chosen * Move UmbracoVersion above FinalVersion Otherwise, rider will use UmbracoVersion for some weird reason * Fix healthcheck * Use else instead of second if for modelsbuilder * Obsolete UmbracoVersion * Remove custom release option * Use forward slashes for volumes * Add MSSQL_SA_PASSWORD env variable * Temporarily limit acceptance tests so it works * Try again * Disable SQLServer integration tests * Set UseHttps to false in appsettings.Development.json You still want to be able to use non-https when developing locally * Fix LTS version LTS still needs installer endpoints added * Update permissions of wwwroot/umbraco for v13 sites * Fix conditional in Program.cs * Undo pipeline shenanigans
2024-08-26 11:21:02 +02:00
services:
umb_database:
container_name: umbraco_image_database
build:
context: ./Database
environment:
SA_PASSWORD: ${DB_PASSWORD}
MSSQL_SA_PASSWORD: ${DB_PASSWORD}
ports:
- "1433:1433"
- "1434:1434"
volumes:
- umb_database:/var/opt/mssql
networks:
- umbnet
healthcheck:
# This healthcheck is to make sure that the database is up and running before the umbraco container starts.
# It works by querying the database for the state of the umbracoDb database, ensuring it exists.
test: ./healthcheck.sh
interval: 5m
timeout: 5s
retries: 3
start_period: 15s # Bootstrap duration, for this duration failures does not count towards max retries.
start_interval: 5s # How long after the health check has started to run the healthcheck again.
umbraco_image:
image: umbraco_image
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__umbracoDbDSN=Server=umb_database;Database=umbracoDb;User Id=sa;Password=${DB_PASSWORD};TrustServerCertificate=true;
- ConnectionStrings__umbracoDbDSN_ProviderName=Microsoft.Data.SqlClient
volumes:
- umb_media:/app/wwwroot/media
- umb_scripts:/app/wwwroot/scripts
- umb_styles:/app/wwwroot/css
- umb_logs:/app/umbraco/Logs
- umb_views:/app/Views
- umb_data:/app/umbraco
- umb_models:/app/umbraco/models
build:
context: .
dockerfile: UmbracoProject/Dockerfile
args:
- BUILD_CONFIGURATION=Debug
depends_on:
umb_database:
condition: service_healthy
restart: always
ports:
- "TEMPLATE_PORT:8080"
networks:
- umbnet
develop:
# This allows you to run docker compose watch, after doing so the container will rebuild when the models are changed.
# Once a restart only feature is implemented (https://github.com/docker/compose/issues/11446)
# It would be really nice to add a restart only watch to \Views, since the file watchers for recompilation of Razor views does not work with docker.
watch:
- path: ./UmbracoProject/umbraco/models
action: rebuild
# These volumes are all made as bind mounts, meaning that they are bound to the host machine's file system.
# This is to better facilitate local development in the IDE, so the views, models, etc... are available in the IDE.
# This can be changed by removing the driver and driver_opts from the volumes.
volumes:
umb_media:
driver: local
driver_opts:
type: none
device: ./UmbracoProject/wwwroot/media
o: bind
umb_scripts:
driver: local
driver_opts:
type: none
device: ./UmbracoProject/wwwroot/scripts
o: bind
umb_styles:
driver: local
driver_opts:
type: none
device: ./UmbracoProject/wwwroot/css
o: bind
umb_logs:
umb_views:
driver: local
driver_opts:
type: none
device: ./UmbracoProject/Views
o: bind
umb_data:
umb_models:
driver: local
driver_opts:
type: none
device: ./UmbracoProject/umbraco/models
o: bind
umb_database:
networks:
umbnet:
driver: bridge