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

Development container added #202

Open
wants to merge 3 commits into
base: master
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
56 changes: 56 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FROM ubuntu:18.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
autoconf \
libtool \
pkg-config \
clang-5.0 \
libgflags-dev \
libgtest-dev \
libc++-dev \
software-properties-common \
python-dev \
python-pip \
python3-dev \
python3-pip \
cmake \
wget \
curl \
gpg-agent \
git \
vim

ARG USERNAME=sim
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Non-root user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& mkdir -p /home/$USERNAME/.vscode-server /home/$USERNAME/.vscode-server-insiders \
&& chown ${USER_UID}:${USER_GID} /home/$USERNAME/.vscode-server* \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& usermod -a -G audio,video $USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

USER $USERNAME
ENV HOME /home/$USERNAME
WORKDIR $HOME

# Node.js 8 LTS
RUN curl -sL https://deb.nodesource.com/setup_8.x | sudo bash - && \
sudo apt-get update && sudo apt-get install -y \
nodejs

RUN sudo npm install -g node-gyp
RUN sudo npm install -g grpc --unsafe-perm

ENV DEBIAN_FRONTEND=
13 changes: 13 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "socialvr",
"dockerFile": "Dockerfile",
"runArgs": ["--name", "socialvr"],
"appPort": ["3000:3000"],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"ms-vscode.vscode-typescript-tslint-plugin",
"eamodio.gitlens"
]
}
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,27 @@ Browser based editor tool for the Social VR project.
* PostCss - obviates the need for vendor prefixes in CSS files.
* WebPack - provides JS bundling, an easy to use dev server, build options, and more.
* ThreeJS - Cross-browser 3D graphics with WebGL.
* Docker containers inside VSCode Editor.

### Installation and Usage
- See [WIKI page on Browser Editor Local Build](https://github.com/cmuartfab/social-vr/wiki/Browser-Editor-Local-Build)
- See [WIKI page on CSS design instructions](https://github.com/cmuartfab/social-vr/wiki/Browser-Editor-CSS-Architecture)

#### Docker and VScode
Using VSCode you need to install the specific development extensions, more info: [Developing inside a Container](https://code.visualstudio.com/docs/remote/containers)

After all the dependencies are installed, you need to:

1) Clone this repo.
2) Start VS Code within the repo and click on the quick actions Status Bar item in the lower left corner of the window.
3) Click on Re Open in container. This will create and image of this repo.
4) In VScode go to terminal: New Terminal.
5) Run `npm install` to install all dependencies.
6) Proceed as below.

### Local Builds
* Point to a locally running server: ```npm run dev-local```
* Point to the staging server: ```npm run dev```
* Point to the staging server: ```npm run dev``` this will open the application on port 3000.
* Point to production: ```npm run dev-prod```

### Deploy
Expand Down
Loading