-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add project tye support to template project #105
Comments
This is what I came up with:
# tye application configuration file
# read all about it at https://github.com/dotnet/tye
#
# when you've given us a try, we'd love to know what you think:
# https://aka.ms/AA7q20u
#
name: peachpie-wordpress
services:
- name: app
project: app/app.csproj
- name: wordpress-mysql
image: mysql/mysql-server:latest
bindings:
- port: 3306
env:
- name: MYSQL_ROOT_PASSWORD
value: "P@ssw0rd"
- name: MYSQL_DATABASE
value: "wordpress"
- name: MYSQL_USER
value: "user"
- name: MYSQL_PASSWORD
value: "P@ssw0rd" In static void Main(string[] args)
{
Directory.SetCurrentDirectory(Path.GetDirectoryName(typeof(Program).Assembly.Location));
//
var host = WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
//.UseUrls("http://*:5004/")
.Build();
host.Run();
} Update connection details in ``appsettings.Development.json```: {
"WordPress": {
"dbhost": "localhost",
"dbpassword": "P@ssw0rd",
"dbuser": "user",
"dbname": "wordpress",
}
} Now you have the Wordpress db in MySQL running in Docker. Am I missing something? I have not figured out persistence and mapping volumes yet. |
Update: Mount - name: wordpress-mysql
image: mysql/mysql-server:latest
bindings:
- port: 3306
env:
- name: MYSQL_ROOT_PASSWORD
value: "P@ssw0rd"
- name: MYSQL_DATABASE
value: "wordpress"
- name: MYSQL_USER
value: "user"
- name: MYSQL_PASSWORD
value: "P@ssw0rd"
volumes:
- source: .data/mysql
target: /var/lib/mysql And to bind the Wordpress app to specific port: name: peachpie-wordpress
services:
- name: app
project: app/app.csproj
bindings:
- port: 5004
protocol: http The ports assigned will normally be random. I'm working on a sample for a headless app using Blazor as a frontend. |
Here is my headless Wordpress with a Blazor frontend: https://github.com/robertsundstrom/headless-wordpress-blazor |
Description
Add a tye configuration file that configures the app project and MySQL (in Docker).
Reason
It makes it easier to start developing without having to install MySQL locally.
What needs to be done
tye.yaml
fileMicrosoft.Tye.Extensions.Configuration
packageQuestion
Is it difficult to do this?
The text was updated successfully, but these errors were encountered: