Skip to content

Consider using a separate docker container between the app and development environment #4029

Open
@jcscottiii

Description

@jcscottiii

Background

Currently, we have three Dockerfiles:

  1. https://github.com/web-platform-tests/wpt.fyi/blob/main/Dockerfile
  2. https://github.com/web-platform-tests/wpt.fyi/blob/main/api/query/cache/service/Dockerfile
  3. https://github.com/web-platform-tests/wpt.fyi/blob/main/results-processor/Dockerfile

Dockerfile 1 provides an environment with consistent tools so that we can build the main webapp service. But the deployment of the webapp does not use Dockerfile when running. Like the other two services. Instead, it relies on buildpacks to build the executable on deploy.
Dockerfile 2 builds the image for the search cache service
Dockerfile 3 builds the image for the results processor service.

Problem

Sometimes when we upgrade Dockerfile 1, the PR is unable to deploy the webapp. This is mainly due to the fact the deployment always pulls from the :latest tag instead of the newly built image tag for that PR.

Suggestion

Make Dockerfile 2 a common Go Dockerfile that both search cache and the webapp use. And we can use Dockerfile arguments to specify at build time which binary to build in this Go Dockerfile. (Can look at this Dockerfile for inspiration. It should be simpler since we don't use multiple Go modules). After doing this, we would need to change the runtime in both prod and staging app.yaml files from go1xx to custom like we do for the search cache service.

Out of scope for this issue but something to consider in a separate issue

Should the Dockerfile in the root of the repository be changed to use devcontainer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions