plaid / pattern

An example end-to-end Plaid integration to create items and fetch transaction data
MIT License
434 stars 216 forks source link

Docker compose configuration doesn't reference local files or docker configuration #239

Closed amaschas closed 2 years ago

amaschas commented 2 years ago

From what I am able to determine, the default docker compose configuration doesn't actually reference the local Dockerfiles, and thus does not use the local code in any way, but rather pulls images from plaidinc/pattern-server:1.0.7 and plaidinc/pattern-ngrok:1.0.7. As a result, if you follow the documented procedure to get the codebase running, you are not in fact running any of the code in the repository that you are browsing. It appears that the debug configuration does mount local directories, which is the behavior I would expect, but it's still very confusing that the Dockerfiles for the server and client appear to be unused.

I'm not sure what the utility of a simply pulling docker images from a repository and running them is, as opposed to using the included docker files, but my sense is that the included documentation should make this clear. I think that the preferred setup, which is the one the Quickstart app uses, would be to reference the local docker configuration. Overall, this seems like a pretty significant gotcha for anyone trying to use this repository as a starting point for their own application.

phoenixy1 commented 2 years ago

@lindawoo-plaid would you be able to take a look at this and resolve in whatever way you think best?

lindawoo-plaid commented 2 years ago

Yes, I will take a look

lindawoo-plaid commented 2 years ago

@amaschas , What command are you using to start Docker? The make start command specifies the --build argument to docker-compose, which will always build the image using the local Dockerfile.

The make debug command allows you to make changes to the server or client code and have it be automatically reflected in the browser, whereas the make start command requires you to do a make stop and then another make start to see code changes.

Here's an example where I changed something on the server and the server was rebuilt.

lwoo@lwoo-mbp pattern % make start
Pulling images from Docker Hub (this may take a few minutes)
docker-compose pull
Pulling db     ... done
Pulling server ... done
Pulling ngrok  ... done
Pulling client ... done
Starting Docker services
docker-compose up --build --detach
Creating network "pattern_default" with the default driver
Building server
[+] Building 0.8s (11/11) FINISHED                                                                                                         
 => [internal] load build definition from Dockerfile                                                                                  0.0s
 => => transferring dockerfile: 43B                                                                                                   0.0s
 => [internal] load .dockerignore                                                                                                     0.0s
 => => transferring context: 35B                                                                                                      0.0s
 => [internal] load metadata for docker.io/library/node:10.15.3-alpine                                                                0.5s
 => [internal] load build context                                                                                                     0.0s
 => => transferring context: 16.90kB                                                                                                  0.0s
 => [1/6] FROM docker.io/library/node:10.15.3-alpine@sha256:aa28f3b6b4087b3f289bebaca8d3fb82b93137ae739aa67df3a04892d521958e          0.0s
 => CACHED [2/6] COPY [package.json, /opt/server/]                                                                                    0.0s
 => CACHED [3/6] COPY [package-lock.json, /opt/server/]                                                                               0.0s
 => CACHED [4/6] WORKDIR /opt/server                                                                                                  0.0s
 => CACHED [5/6] RUN npm ci                                                                                                           0.0s
 => [6/6] COPY [./, /opt/server/]  <<<<<<<<<< New source copied to build                                                0.0s
 => exporting to image                                                                                                                0.0s
 => => exporting layers                                                                                                               0.0s
 => => writing image sha256:7c4404b25a597b6e645c3116fa98e9eddb24f4facca861857d6693bcd68b27ab                                          0.0s
 => => naming to docker.io/plaidinc/pattern-server:1.0.7                                                                              0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
Building ngrok
[+] Building 0.6s (11/11) FINISHED                                                                                                         
 => [internal] load build definition from Dockerfile                                                                                  0.0s
 => => transferring dockerfile: 43B                                                                                                   0.0s
 => [internal] load .dockerignore                                                                                                     0.0s
 => => transferring context: 2B                                                                                                       0.0s
 => [internal] load metadata for docker.io/library/alpine:3.9                                                                         0.5s
 => [internal] load build context                                                                                                     0.0s
 => => transferring context: 63B                                                                                                      0.0s
 => [1/6] FROM docker.io/library/alpine:3.9@sha256:414e0518bb9228d35e4cd5165567fb91d26c6a214e9c95899e1e056fcd349011                   0.0s
 => CACHED [2/6] RUN set -x &&     apk add --no-cache -t .deps ca-certificates &&     wget -q -O /etc/apk/keys/sgerrand.rsa.pub http  0.0s
 => CACHED [3/6] RUN set -x     && apk add --no-cache curl     && curl -Lo /ngrok.zip https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-sta  0.0s
 => CACHED [4/6] RUN ngrok --version                                                                                                  0.0s
 => CACHED [5/6] COPY --chown=ngrok ngrok.yml /home/ngrok/.ngrok2/                                                                    0.0s
 => CACHED [6/6] COPY entrypoint.sh /                                                                                                 0.0s
 => exporting to image                                                                                                                0.0s
 => => exporting layers                                                                                                               0.0s
 => => writing image sha256:e651548b3236172b6b4e025ea8d422a8f0e5f9bbefd8e7bdd4f954f611a16b9b                                          0.0s
 => => naming to docker.io/plaidinc/pattern-ngrok:1.0.7                                                                               0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
Building client
[+] Building 0.3s (12/12) FINISHED                                                                                                         
 => [internal] load build definition from Dockerfile                                                                                  0.0s
 => => transferring dockerfile: 43B                                                                                                   0.0s
 => [internal] load .dockerignore                                                                                                     0.0s
 => => transferring context: 35B                                                                                                      0.0s
 => [internal] load metadata for docker.io/library/node:10.15.3-alpine                                                                0.2s
 => [1/7] FROM docker.io/library/node:10.15.3-alpine@sha256:aa28f3b6b4087b3f289bebaca8d3fb82b93137ae739aa67df3a04892d521958e          0.0s
 => [internal] load build context                                                                                                     0.0s
 => => transferring context: 3.12kB                                                                                                   0.0s
 => CACHED [2/7] COPY [package.json, /opt/client/]                                                                                    0.0s
 => CACHED [3/7] COPY [package-lock.json, /opt/client/]                                                                               0.0s
 => CACHED [4/7] WORKDIR /opt/client                                                                                                  0.0s
 => CACHED [5/7] RUN npm ci                                                                                                           0.0s
 => CACHED [6/7] COPY [src/, /opt/client/src/]                                                                                        0.0s
 => CACHED [7/7] COPY [public/, /opt/client/public/]                                                                                  0.0s
 => exporting to image                                                                                                                0.0s
 => => exporting layers                                                                                                               0.0s
 => => writing image sha256:f3f653c391110a5b938e616fa9d6bb1267ad0789366a7d2267059bf75650cf63                                          0.0s
 => => naming to docker.io/plaidinc/pattern-client:1.0.7                                                                              0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
Creating pattern_db_1 ... done
Creating pattern_server_1 ... done
Creating pattern_client_1 ... done
Creating pattern_ngrok_1  ... done
./wait-for-client.sh
Waiting for the client to finish initializing...................
The client is ready!
Open localhost:3001 in your browser to view the client.
Run 'make logs' to view the service logs.
Run 'make stop' to stop the docker containers.
Run 'make help' to view other available commands.
amaschas commented 2 years ago

I apologize, I actually closed this item because I realized that I was misreading the docker-compose.yml, but it appears someone re-opened it.

lindawoo-plaid commented 1 year ago

Yes, I can resolve this.

On Tue, Jun 21, 2022 at 12:22 PM Alex @.***> wrote:

@lindawoo-plaid https://github.com/lindawoo-plaid would you be able to take a look at this and resolve in whatever way you think best?

— Reply to this email directly, view it on GitHub https://github.com/plaid/pattern/issues/239#issuecomment-1162227508, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASQW5RRLV7VJHOYWYPM4LVTVQIJA5ANCNFSM5ZMYIGNA . You are receiving this because you were mentioned.Message ID: @.***>