Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v0.0.95
_commit: v0.0.96
_src_path: gh:LabAutomationAndScreening/copier-base-template.git
description: A web app that is hosted within a local intranet. Nuxt frontend, python
backend, docker-compose
Expand Down
13 changes: 9 additions & 4 deletions template/.devcontainer/Dockerfile
Copy link
Contributor

Choose a reason for hiding this comment

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

are you running your devcontainers inside WSL? maybe that explains some of the differences in behaviors we've observed. my files are on my regular windows hard drive. I know it's better to have them in the WSL "hard drive", but I haven't had a chance to figure that out yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes using WSL "hard drive"

Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ RUN apt-get update -y && apt-get install -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Create the venv folder and set permissions for anyone to modify---this is necessary to be able to break out the venv folder as a separate docker volume for better performance on Windows hosts
# Create the workspace folders that have docker volume (see docker-compose.yaml) and set permissions for anyone to modify
# this is necessary to be able to break out these folders as a separate docker volume for better performance on Windows hosts
ARG REPO_NAME=copier-base-template
ENV VENV_PATH=/workspaces/${REPO_NAME}/.venv
ENV VENV_PATH=/workspaces/${REPO_NAME}/backend/.venv
ENV PNPM_STORE=/workspaces/${REPO_NAME}/.pnpm-store
ENV FRONTEND_NODE_MODULES=/workspaces/${REPO_NAME}/frontend/node_modules
Comment on lines +19 to +21
Copy link
Contributor

Choose a reason for hiding this comment

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

we have several copier templates that have venv/node_modules that are not in the repo root. at some point (not saying now) we should probably move this into copier-base template and make a copier task in the sub-template that just adjusts the paths. the task could be defined in the copier.yaml.jinja-base in the base template, and just read from the envs.json that defines the paths for the different python/node environments in the template

Copy link
Contributor Author

Choose a reason for hiding this comment

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

RUN mkdir -p /workspaces && \
mkdir -p ${VENV_PATH} && \
chmod -R 777 /workspaces ${VENV_PATH} && \
chgrp -R 0 /workspaces ${VENV_PATH}
mkdir -p ${PNPM_STORE} && \
mkdir -p ${FRONTEND_NODE_MODULES} && \
chmod -R 777 /workspaces ${VENV_PATH} ${PNPM_STORE} ${FRONTEND_NODE_MODULES} && \
chgrp -R 0 /workspaces ${VENV_PATH} ${PNPM_STORE} ${FRONTEND_NODE_MODULES}

# SSH
EXPOSE 2222
6 changes: 6 additions & 0 deletions template/.devcontainer/devcontainer.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
"service": "devcontainer",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"features": {{% endraw %}{% if is_child_of_copier_base_template is not defined %}{% raw %}
"ghcr.io/devcontainers/features/git-lfs:1.2.5": {
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be a change in the base template?

Copy link
Contributor

Choose a reason for hiding this comment

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

if you wanna just add a note to yourself, and not make the change now, that's fine. I just don't want to forget

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably worthwhile to put at that level too. Since figuring it out i haven't gone back and tried to use other non "python/nuxt project" based things as a devcontainer. So i wouldn't be surprised if its broken there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

merged and updated this branch. :beg: for another approval please

// we are not using git-lfs right now, but its a transitive dep elsewhere. We want to configure auto pull to off since the feature will by default also try to install the git hook
// and it breaks creation of the devcontainer since pre-commit hooks are already in place. Probably a better way to fix this but until we use git-lfs we can leave it like this.
// https://github.com/devcontainers/features/blob/main/src/git-lfs/README.md
"autoPull": false
},
"ghcr.io/devcontainers/features/aws-cli:1.1.2": {
// https://github.com/devcontainers/features/blob/main/src/aws-cli/devcontainer-feature.json
// view latest version https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst
Expand Down