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

Fix devcontainer configuration #1256

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
39 changes: 4 additions & 35 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,5 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.191.1/containers/typescript-node/.devcontainer/base.Dockerfile
# See comments in devcontainer.json for details of setting the playwright tag.
ARG PLAYWRIGHT_TAG="v1.28.0-focal"
FROM mcr.microsoft.com/playwright:${PLAYWRIGHT_TAG}

# [Choice] Node.js version: 16, 14, 12
ARG VARIANT="16-buster"
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
openjdk-11-jdk \
firefox-esr

# Chromium and chrome-driver
ARG CHROMIUM_DEB_URL=https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN wget -qO - $CHROMIUM_DEB_URL > /tmp/chrome_linux64.deb \
&& apt -y install /tmp/chrome_linux64.deb -f \
&& FULL_CHROME_VERSION=$(google-chrome --product-version) \
&& CHROME_VERSION=${FULL_CHROME_VERSION%.*} \
&& CHROMEDRIVER_DIR="/usr/local/share/chrome_driver" \
&& CHROMEDRIVER_BIN="$CHROMEDRIVER_DIR/chromedriver" \
&& LATEST_CHROMEDRIVER_VERSION=$(curl -sL "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION") \
&& CHROMEDRIVER_URL="https://chromedriver.storage.googleapis.com/$LATEST_CHROMEDRIVER_VERSION/chromedriver_linux64.zip" \
&& wget -qO - $CHROMEDRIVER_URL > /tmp/chromedriver_linux64.zip \
&& mkdir -p $CHROMEDRIVER_DIR \
&& unzip -qq /tmp/chromedriver_linux64.zip -d $CHROMEDRIVER_DIR \
&& chmod +x $CHROMEDRIVER_BIN \
&& ln -s "$CHROMEDRIVER_BIN" /usr/bin/ \
&& rm -rf /tmp/chrome*

# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

# [Optional] Uncomment if you want to install more global node packages
# RUN su node -c "npm install -g <your-package-list -here>"
WORKDIR /app
24 changes: 11 additions & 13 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.191.1/containers/typescript-node
{
"name": "Node.js & TypeScript",
"name": "Node.js & Playwright",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 12, 14, 16
// Change to pick a different tag, see https://mcr.microsoft.com/en-us/product/playwright/tags
//
// IMPORTANT: The playwright image version must match @playwright/test version from package.json.
// Otherwise it will not work, the test version will look for the browser versions which it won't
// find on the image.
//
// pick '...-arm64' version if running on Apple Silicone.
"args": {
"VARIANT": "16"
"PLAYWRIGHT_TAG": "v1.28.0-focal"
}
},
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
"forwardPorts": [9000],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "yarn install && yarn build",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
"postCreateCommand": "yarn install && yarn build"
}
Loading