Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
build(devcontainer): setup a development environment with development…
Browse files Browse the repository at this point in the history
… tooling (#40)
  • Loading branch information
slack-samples[bot] authored Jun 7, 2024
1 parent 0d4cdc1 commit 57368ec
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Use the Ubtuntu base image
FROM ubuntu:22.04

# Download development tools
RUN apt-get update
RUN apt-get install -y curl
RUN apt-get install -y git
RUN apt-get install -y unzip

# Run the container as a user
RUN useradd -m -s /bin/bash slackdev
RUN chown slackdev /usr/local/bin
USER slackdev

# Install the project runtime
RUN curl -fsSL https://deno.land/install.sh | sh
RUN export DENO_INSTALL="/home/slackdev/.deno"
RUN export PATH="$DENO_INSTALL/bin:$PATH"

# Set the working directory
WORKDIR /workspaces

# Install the Slack CLI
RUN curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash -s -- -d
35 changes: 35 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# .devcontainer

A [development container][container] provides a predefined environment with
some tools needed for development, which can be useful in editors such as
[Visual Studio Code][vscode] or remote settings like [Codespaces][codespaces].

This specific container packages [the Slack CLI][cli] with the project runtime
and a few development tools. The `Dockerfile` details the container.

## Editor extensions

Modifications to an editor can be made with changes to the `devcontainer.json`
file:

```diff
{
"customizations": {
"vscode": {
"extensions": [
+ "GitHub.copilot",
"denoland.vscode-deno",
"ms-azuretools.vscode-docker"
],
+ "settings": {
+ "terminal.integrated.defaultProfile.linux": "zsh"
+ }
}
}
}
```

[codespaces]: https://github.com/features/codespaces
[cli]: https://api.slack.com/automation/cli
[container]: https://containers.dev/
[vscode]: https://code.visualstudio.com/docs/devcontainers/containers
13 changes: 13 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "Slack Platform",
"dockerFile": "Dockerfile",
"remoteUser": "slackdev",
"customizations": {
"vscode": {
"extensions": [
"denoland.vscode-deno",
"ms-azuretools.vscode-docker"
]
}
}
}

0 comments on commit 57368ec

Please sign in to comment.