小编Pau*_*ulo的帖子

如何在 Dockerfile 上运行两个命令?

我必须在 docker 文件上执行两个命令,但是这两个命令都附加到终端并阻止下一个执行。

码头档案:

FROM sinet/nginx-node:latest

RUN mkdir /usr/src/app

WORKDIR /usr/src/app

RUN git clone https://name:pass@bitbucket.org/joaocromg/front-web-alferes.git
WORKDIR /usr/src/app/front-web-alferes

RUN npm install 

RUN npm install bower -g 
RUN npm install gulp -g 
RUN bower install --allow-root 

COPY default.conf /etc/nginx/conf.d/

RUN nginx -g 'daemon off;' & # command 1 blocking

CMD ["gulp watch-dev"] # command 2 not executed
Run Code Online (Sandbox Code Playgroud)

有人知道我该如何解决这个问题?

nginx docker gulp dockerfile docker-compose

7
推荐指数
2
解决办法
1万
查看次数

使用 Visual Studio Code 配置调试 PHP 时出现问题

我正在尝试按照本教程在 VS Code 上配置 XDebug:

https://blogs.msdn.microsoft.com/nicktrog/2016/02/11/configuring-visual-studio-code-for-php-development/

但在这一点上:

在此输入图像描述

VS Code 不显示 PHP 选项。

我尝试重新安装 VS Code 和 XDebug。我尝试重新安装 php 服务器并更改 PHP 服务器,但没有任何效果。

我创建了其他教程,但向我展示了同样的问题:当我单击 gear 时,只显示不带 php 选项的 launch.json

在此输入图像描述

php wamp xdebug visual-studio-code

3
推荐指数
1
解决办法
2964
查看次数

asp.net 核心不加载静态文件

我有一个带有以下代码的应用程序 .NET core 2.1:

 public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        app.UseStaticFiles();
        app.UseStaticFiles(new StaticFileOptions
        {
            FileProvider = new PhysicalFileProvider(
        Path.Combine(Directory.GetCurrentDirectory(), "Assets")),
            RequestPath = "/Assets"
        });
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
        else
        {
            app.UseHsts();
        }

        app.UseHttpsRedirection();
        app.UseMvc();
    }
Run Code Online (Sandbox Code Playgroud)

和我的结构文件夹:

在此处输入图片说明

但这些网址都没有打开图像:

“my-website.com/images/snes/alien.jpg”

“my-website.com/wwwroot/images/snes/alien.jpg”

“my-website.com/Assets/Snes/alien.jpg”

有人知道出了什么问题吗?

编辑:这是 CurrentDirectoy() 方法获取的文件夹(显然是正确的):

在此处输入图片说明

Edit2:使用此代码在 localhost 上工作,但在我在 azure 上发布时却没有:

 app.UseFileServer(
        new FileServerOptions()
        {
            FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot"))
        });
Run Code Online (Sandbox Code Playgroud)

c# .net-core kestrel-http-server asp.net-core

0
推荐指数
3
解决办法
8574
查看次数

选择Linq不调用方法

我有这个代码Linq c#

from r in Employer.Restrictions 
select new RestrictionDto(r);
Run Code Online (Sandbox Code Playgroud)

雇主限制在注册,但RestrictionDto的构造函数从未被调用,只返回null.我在restrictionDto中放了一个breakPoint,代码永远不会停止.

我以前从未见过这个问题.我在代码中有很多这样的代码并且工作正常.

有人可以帮忙吗?

c# linq

-1
推荐指数
1
解决办法
91
查看次数