Skip to content
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

[deployment] Cannot deploy on production environment #790

Closed
yychen opened this issue Jun 4, 2020 · 5 comments
Closed

[deployment] Cannot deploy on production environment #790

yychen opened this issue Jun 4, 2020 · 5 comments
Assignees
Labels
bug P0 Priority 0 (URGENT)

Comments

@yychen
Copy link
Member

yychen commented Jun 4, 2020

Description

docker-compose won't work
Since docker-compose.yml is moved to the contrib folder, the original deployment method docker-compose up --build -d at project root level does not work.

An alternative is to use docker-compose -f contrib/docker-compose.yml up --build -d, but I think it kind of lose the benefit of cutting the command short by using the default naming.

But either case won't work. Because in docker-compose.yml, it says to build . whereas the Dockerfile is actually at ... I think we can work out a better solution.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Run docker-compose up --build -d at the project root directory (In this case, ~/web-projects/pycontw-2020 in the production / staging server)
  2. You'll see the error message
ERROR: 
        Can't find a suitable configuration file in this directory or any
        parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml

Alternative step:

  1. Run docker-compose -f contrib/docker-compose.yml up --build -d
  2. You'll see the error message
Building web
ERROR: Cannot locate specified Dockerfile: Dockerfile

Expected Behavior

It should start building, recreate the image and run it.

Actual Behavior

It did not build.

Additional context

Or, should we run it inside the contrib folder? It seems a little bit weird to me, and I need to test it out because in my past experience, docker-compose kind of remember which folder you run it. Need to make sure if it causes any problem.

Can test it on the staging environment.

@yychen yychen added triage needed The bug report may be just filed. Please triage it. P0 Priority 0 (URGENT) labels Jun 4, 2020
@tai271828
Copy link
Member

Let me resolve in the following steps:

  1. (short term) keep the folder of contrib for PR Containerized development environment #783 by moving production files to the upper folder, or creating symbolic links for them. I personally prefer to use symbolic.
  2. We may use this issue thread to keep discussion which kind of location convention we may want. Referring to those famous open source projects should help. (see the next comment for the collection of open source projects)

@tai271828
Copy link
Member

tai271828 commented Jun 4, 2020

Projects with using contrib and Dockerfile is inside contrib

  • xxx

Projects with using contrib and Dockerfile is NOT inside contrib

  • xxx

Projects without using contrib

  • Django

@tai271828
Copy link
Member

I will deliver step1 by the end of today to let us move forward to deploy production site.

@yychen
Copy link
Member Author

yychen commented Jun 4, 2020

Let me resolve in the following steps:

1. (short term) keep the folder of `contrib` for PR #783 by moving production files to the upper folder, or creating symbolic links for them. I personally prefer to use symbolic.

Looks good to me!

I actually deployed the latest code this morning. I just manually move the docker-compose.yml to upper level directory. So the repository in the production is temporary inconsistent to the one in github. But we'll fix it after we have a solution.

tai271828 added a commit to tai271828/pycon.tw that referenced this issue Jun 4, 2020
By applying pull request pycontw#772 we introduce this issue. This pull request
applies a short-term fix according to the discussion of issue pycontw#790.
tai271828 added a commit to tai271828/pycon.tw that referenced this issue Jun 4, 2020
By applying pull request pycontw#772 we introduce this issue. This pull request
applies a short-term fix according to the discussion of issue pycontw#790.
tai271828 added a commit to tai271828/pycon.tw that referenced this issue Jun 4, 2020
By applying pull request pycontw#772 we introduce this issue. This pull request
applies a short-term fix according to the discussion of issue pycontw#790.
tai271828 added a commit to tai271828/pycon.tw that referenced this issue Jun 4, 2020
By applying pull request pycontw#772 we introduce this issue. This pull request
applies a short-term fix according to the discussion of issue pycontw#790.
@yychen yychen added bug and removed triage needed The bug report may be just filed. Please triage it. labels Jun 14, 2020
gtbcoding pushed a commit to gtbcoding/pycon.tw that referenced this issue Jul 27, 2020
By applying pull request pycontw#772 we introduce this issue. This pull request
applies a short-term fix according to the discussion of issue pycontw#790.
@mattwang44
Copy link
Member

I think it's no longer an issue now. Will open a new issue if we got similar problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P0 Priority 0 (URGENT)
Projects
None yet
Development

No branches or pull requests

3 participants