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

Nick10 31 new devcontainer for codespaces #116

Merged
merged 3 commits into from
Oct 31, 2023
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
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
"name": "TalkForm",

// NOTE: because codespaces automatically
"dockerFile": "../Dockerfile",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// "image": "mcr.microsoft.com/devcontainers/typescript-node:1-18-bullseye",
Expand Down Expand Up @@ -40,7 +41,8 @@
}
},

// TODO can't get the yarn install within Dockerfile to show up in dev container
// TODO can't get the yarn install within Dockerfile to show up in dev container.
// This also seems to be what the Microsoft example devcontainers do.
"postCreateCommand": "yarn install --frozen-lockfile",

// Configure tool-specific properties.
Expand Down
33 changes: 33 additions & 0 deletions .devcontainer/local/deprecated-Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Use the specified image
# this had trouble with the `yarn install`
# FROM mcr.microsoft.com/devcontainers/typescript-node:1-18-bullseye
# FROM node:18.15.0-alpine
FROM node:18.15.0-bullseye-slim

# Set the working directory
WORKDIR /app

# necessary for some of the npm packages
RUN apt-get update && apt-get install -y \
python3 \
make \
g++

# https://docs.doppler.com/docs/install-cli
RUN apt-get update && apt-get install -y apt-transport-https ca-certificates curl gnupg && \
curl -sLf --retry 3 --tlsv1.2 --proto "=https" 'https://packages.doppler.com/public/cli/gpg.DE2A7741A397C129.key' | gpg --dearmor -o /usr/share/keyrings/doppler-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/doppler-archive-keyring.gpg] https://packages.doppler.com/public/cli/deb/debian any-version main" | tee /etc/apt/sources.list.d/doppler-cli.list && \
apt-get update && \
apt-get -y install doppler

# Copy package.json and yarn.lock into the working directory
COPY package.json yarn.lock ./

# Install dependencies using yarn
RUN yarn install --frozen-lockfile

# Copy the rest of the project files into the working directory
COPY . .

# Expose the port your app runs on
EXPOSE 3000
65 changes: 65 additions & 0 deletions .devcontainer/local/deprecated-devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "TalkForm",

// NOTE: because codespaces automatically
"dockerFile": "../../Dockerfile.full",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// "image": "mcr.microsoft.com/devcontainers/typescript-node:1-18-bullseye",


// https://community.doppler.com/t/vscode-container-support/104
// https://community.doppler.com/t/doppler-and-github-codespaces/989/2
"containerEnv": {
"DOPPLER_TOKEN": "${localEnv:DOPPLER_CLI_TOKEN}"
},

// "features": {
// "ghcr.io/devcontainers-contrib/features/supabase-cli:1": {}
// },

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// "settings": {
// "terminal.integrated.shell.linux": "/bin/bash"
// },


// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
3000
],
"features": {
"ghcr.io/devcontainers/features/git:1": {}
},

"portsAttributes": {
"3000": {
"label": "website"
}
},

// TODO can't get the yarn install within Dockerfile to show up in dev container
"postCreateCommand": "yarn install --frozen-lockfile",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"esbenp.prettier-vscode",
"GitHub.copilot",
"k--kato.intellij-idea-keybindings",
"Orta.vscode-jest",
"ms-azuretools.vscode-docker"
]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# FROM node:18.15.0-alpine
FROM node:18.15.0-bullseye-slim

# Set the working directory
WORKDIR /app
# codespaces automatically clones the repo into /workspaces/<repo-name>
# WORKDIR /app

# necessary for some of the npm packages
RUN apt-get update && apt-get install -y \
Expand All @@ -20,14 +20,14 @@ RUN apt-get update && apt-get install -y apt-transport-https ca-certificates cur
apt-get update && \
apt-get -y install doppler

# Copy package.json and yarn.lock into the working directory
COPY package.json yarn.lock ./
# codespaces automatically clones the repo into /workspaces/<repo-name>
# COPY package.json yarn.lock ./

# Install dependencies using yarn
# codespaces automatically clones the repo into /workspaces/<repo-name>
RUN yarn install --frozen-lockfile

# Copy the rest of the project files into the working directory
COPY . .
# COPY . .

# Expose the port your app runs on
EXPOSE 3000
Loading