Skip to content

Commit

Permalink
Added devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
ItalyPaleAle committed Sep 20, 2020
1 parent 1a9590b commit dcc3284
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/javascript-node/.devcontainer/base.Dockerfile

# Based on Node.js 14
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-14

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [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 modules
# RUN sudo -u node npm install -g <your-package-list-here>
34 changes: 34 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// 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.140.1/containers/javascript-node
{
"name": "svelte-spa-router",

"dockerComposeFile": "docker-compose.yaml",
"service": "development",
"workspaceFolder": "/workspace",

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/usr/bin/zsh"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"bierner.markdown-preview-github-styles",
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"eg2.vscode-npm-script",
"svelte.svelte-vscode",
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
5000
],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install",

// Connect as a non-root user
"remoteUser": "node"
}
29 changes: 29 additions & 0 deletions .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3'

services:
development:
build:
context: .
dockerfile: Dockerfile
volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- ..:/workspace:cached
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
# Use a non-root user for all processes.
user: node
environment:
- 'SELENIUM_HOST=selenium-chrome'
- 'SELENIUM_PORT=4444'
- 'LAUNCH_URL=http://nginx'
nginx:
image: nginx:1.19
container_name: nginx
volumes:
- ../test/app/dist:/usr/share/nginx/html:ro
ports:
- 8080:80
selenium-chrome:
image: selenium/standalone-chrome:85.0
container_name: selenium-chrome
shm_size: '2gb'

0 comments on commit dcc3284

Please sign in to comment.