Skip to content

Commit e5f4813

Browse files
author
Ayane Satomi
committed
readme: add Heroku button
needs a specialized Heroku container as well since VOLUME won't work Signed-off-by: Ayane Satomi <sr229@coder.com>
1 parent ec4eafe commit e5f4813

4 files changed

Lines changed: 87 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Try it out:
99
```bash
1010
docker run -it -p 127.0.0.1:8080:8080 -v "${HOME}/.local/share/code-server:/home/coder/.local/share/code-server" -v "$PWD:/home/coder/project" codercom/code-server:v2
1111
```
12+
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
1213

1314
[![Run on Google Cloud](https://storage.googleapis.com/cloudrun/button.svg)](https://deploy.cloud.run)
1415

app.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "code-server",
3+
"description": "Visual Studio Code in the Web",
4+
"keywords": [
5+
"vscode",
6+
"code-server"
7+
],
8+
"repository": "https://github.com/ClarityCafe/F.Lute",
9+
"logo": "https://cdn.discordapp.com/avatars/436026947974463488/7eb55b489b3335e1bf78891bc3b38ae1.png?size=512",
10+
"env": {
11+
"PASSWORD": {
12+
"description": "Password for your instance. This is required.",
13+
"value": "heroku"
14+
}
15+
},
16+
"stack": "container",
17+
"formation": {
18+
"web": {
19+
"quantity": 1
20+
}
21+
}
22+
}

heroku.dockerfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
FROM node:10.16.0
2+
ARG codeServerVersion=docker
3+
ARG vscodeVersion=1.38.1
4+
ARG githubToken
5+
6+
# Install VS Code's deps. These are the only two it seems we need.
7+
RUN apt-get update && apt-get install -y \
8+
libxkbfile-dev \
9+
libsecret-1-dev
10+
11+
# Ensure latest yarn.
12+
RUN npm install -g yarn@1.13
13+
14+
WORKDIR /src
15+
COPY . .
16+
17+
RUN yarn \
18+
&& MINIFY=true GITHUB_TOKEN="${githubToken}" yarn build "${vscodeVersion}" "${codeServerVersion}" \
19+
&& yarn binary "${vscodeVersion}" "${codeServerVersion}" \
20+
&& mv "/src/build/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x86_64-built/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x86_64" /src/build/code-server \
21+
&& rm -r /src/build/vscode-* \
22+
&& rm -r /src/build/code-server*-linux-*
23+
24+
# We deploy with ubuntu so that devs have a familiar environment.
25+
FROM ubuntu:18.04
26+
27+
RUN apt-get update && apt-get install -y \
28+
openssl \
29+
net-tools \
30+
git \
31+
locales \
32+
sudo \
33+
dumb-init \
34+
vim \
35+
curl \
36+
wget
37+
38+
RUN locale-gen en_US.UTF-8
39+
# We cannot use update-locale because docker will not use the env variables
40+
# configured in /etc/default/locale so we need to set it manually.
41+
ENV LC_ALL=en_US.UTF-8
42+
43+
RUN adduser --gecos '' --disabled-password coder && \
44+
echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
45+
46+
USER coder
47+
# We create first instead of just using WORKDIR as when WORKDIR creates, the
48+
# user is root.
49+
RUN mkdir -p /home/coder/project
50+
51+
WORKDIR /home/coder/project
52+
53+
COPY --from=0 /src/build/code-server /usr/local/bin/code-server
54+
EXPOSE 8080
55+
56+
ENTRYPOINT ["dumb-init", "code-server", "--host", "0.0.0.0"]

heroku.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
build:
2+
docker:
3+
web: heroku.dockerfile
4+
5+
# Setting sane default to add a password.
6+
# Since we'll be running it on a public PaaS
7+
run:
8+
web: dumb-init code-server --host=0.0.0 --auth=password

0 commit comments

Comments
 (0)