Docker-WordPress-Localhost ERR_EMPTY_RESPONSE

时间:2019-01-19 16:10:31

标签: wordpress docker docker-compose localhost

我开始使用Docker for WordPress。我遵循了Docker文档以使其启动并运行:

https://docs.docker.com/compose/wordpress/

我为插件和主题目录添加了卷。

第一次运行命令@EnableWebSecurity public class MultiHttpSecurityConfig { private static final String[] PUBLIC_MATCHERS = { "/css/**", "/js/**", "/image/**", "/newUser", "/forgetPassword", "/", "/login", "/fonts/**", "/admin/adminLogin" }; @Configuration @EnableGlobalMethodSecurity(prePostEnabled = true) @Order(2) public static class UserConfiguration extends WebSecurityConfigurerAdapter { protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() /* .antMatchers("/**")*/ .antMatchers(PUBLIC_MATCHERS).permitAll() .anyRequest().hasAnyRole("USER", "ADMIN"); http .csrf().disable() .cors().disable() .formLogin() .failureUrl("/login?error") .defaultSuccessUrl("/jobList") .loginPage("/login") .permitAll() .and() .logout() .logoutRequestMatcher(new AntPathRequestMatcher("/logout")) .logoutSuccessUrl("/?logout") .deleteCookies("remember-me") .permitAll() .and() .rememberMe(); } @Autowired private UserSecurityService userSecurityService; private BCryptPasswordEncoder passwordEncoder() { return SecurityUtility.passwordEncoder(); } @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userSecurityService).passwordEncoder(passwordEncoder()); } } @Configuration @EnableGlobalMethodSecurity(prePostEnabled = true) @Order(1) public static class AdminConfigurerAdapter extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers(PUBLIC_MATCHERS).permitAll() .anyRequest().hasRole("ADMIN"); http .csrf().disable() .cors().disable() .formLogin() .failureUrl("/login?error") .defaultSuccessUrl("/admin/adminHome") .loginPage("/admin/adminLogin") .permitAll() .and() .logout() .logoutRequestMatcher(new AntPathRequestMatcher("/logout")) .logoutSuccessUrl("/?logout") .deleteCookies("remember-me") .permitAll() .and() .rememberMe(); } @Autowired private UserSecurityService userSecurityService; private BCryptPasswordEncoder passwordEncoder() { return SecurityUtility.passwordEncoder(); } @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth .userDetailsService(userSecurityService) .passwordEncoder(passwordEncoder()); } } } 并转到http://localhost:8000/时,我看到了WordPress的安装。当我重新启动PC并使用docker-compose up -ddocker-compose up -d重新启动服务时,出现错误消息:ERR_EMPTY_RESPONSE。

我尝试过:

  • 删除容器,服务和卷
  • 杀死netstat端口

目前,我不知道为什么它不再起作用了。我正在使用macOS

这是我当前的docker-compose.yml

docker-compose start

运行容器后的状态: enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

遵循这些步骤

  1. @NgModule({ imports: [ Daterangepicker ], exports: [ SomeComponent ], declarations: [ SomeComponent ] }) -两次
  2. 编辑yml文件,并将db_data的所有实例替换为db_datax
  3. 运行@NgModule({ declarations: [ ], imports: [ Daterangepicker, ], providers: [ ], exports: [ Daterangepicker, ] })

或者,

  1. docker-compose down-两次{同样也删除了网络}
  2. docker-compose up -d
  3. docker-compose down