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

chore: update devcontainer to share same network as api/admin #199

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: '3'
services:
# Update this to the name of the service you want to work with in your docker-compose.yml file
notify-ddapi:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works as is? i.e. you didn't have to define a service attribute in the devcontainer.json file? (I didn't try without it -- I guess it assumes it and use it correctly).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it did work fine, but I didnt realize that was over there. I will look more closely at the other repos and make this match. Its too bad there is linting on these type of files since there are clearly dependencies between them!

build:
context: ..
dockerfile: .devcontainer/Dockerfile
# If you want add a non-root user to your Dockerfile, you can use the "remoteUser"
# property in devcontainer.json to cause VS Code its sub-processes (terminals, tasks,
# debugging) to execute as the user. Uncomment the next line if you want the entire
# container to run as this user instead. Note that, on Linux, you may need to
# ensure the UID and GID of the container user you create matches your local user.
# See https://aka.ms/vscode-remote/containers/non-root for details.
user: vscode

volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- ..:/workspace:cached

# Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker-compose for details.
# - /var/run/docker.sock:/var/run/docker.sock

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
expose:
- "7000"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check if there was a conflict with port 7000 when bringing up this devcontainer into vscode? It is possible there might be a conflict and a new port from 7000->random port might get created. In the API, we removed the forward port in devcontainer.json if I am not mistaken.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look. It all worked fine when I rebuilt the container so I assumed it was OK.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the forwarded port section makes it not work at all 🤷

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it back, its all working locally now. Did you want to try it out before I merge?

networks:
- notify-network

networks:
notify-network:
external: true
andrewleith marked this conversation as resolved.
Show resolved Hide resolved
Loading