This repository has been archived by the owner on Apr 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from dwins/docker
Configure docker-compose and VSCode Remote.
- Loading branch information
Showing
6 changed files
with
146 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#------------------------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. | ||
#------------------------------------------------------------------------------------------------------------- | ||
|
||
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-12 | ||
|
||
# The node image includes a non-root user with sudo access. Use the | ||
# "remoteUser" property in devcontainer.json to use it. On Linux, update | ||
# these values to ensure the container user's UID/GID matches your local values. | ||
# See https://aka.ms/vscode-remote/containers/non-root-user for details. | ||
ARG USERNAME=node | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
# [Optional] Update UID/GID if needed | ||
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \ | ||
groupmod --gid $USER_GID $USERNAME \ | ||
&& usermod --uid $USER_UID --gid $USER_GID $USERNAME \ | ||
&& chmod -R $USER_UID:$USER_GID /home/$USERNAME; \ | ||
fi | ||
|
||
# ************************************************************* | ||
# * Uncomment this section to use RUN instructions to install * | ||
# * any needed dependencies after executing "apt-get update". * | ||
# * See https://docs.docker.com/engine/reference/builder/#run * | ||
# ************************************************************* | ||
# ENV DEBIAN_FRONTEND=noninteractive | ||
# RUN apt-get update \ | ||
# && apt-get -y install --no-install-recommends <your-package-list-here> \ | ||
# # | ||
# # Clean up | ||
# && apt-get autoremove -y \ | ||
# && apt-get clean -y \ | ||
# && rm -rf /var/lib/apt/lists/* | ||
# ENV DEBIAN_FRONTEND=dialog | ||
|
||
# Uncomment to default to non-root user | ||
# USER $USER_UID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.101.0/containers/javascript-node-12-postgres | ||
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml. | ||
{ | ||
"name": "PREreview JS dev", | ||
"dockerComposeFile": "docker-compose.yml", | ||
"service": "web", | ||
"workspaceFolder": "/workspace", | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash" | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint" | ||
], | ||
|
||
// Uncomment the next line if you want start specific services in your Docker Compose config. | ||
// "runServices": [], | ||
|
||
// Uncomment the line below if you want to keep your containers running after VS Code shuts down. | ||
// "shutdownAction": "none", | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "yarn install", | ||
|
||
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "node" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#------------------------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. | ||
#------------------------------------------------------------------------------------------------------------- | ||
|
||
version: '3' | ||
services: | ||
web: | ||
# Uncomment the next line to use a non-root user for all processes. You can also | ||
# simply use the "remoteUser" property in devcontainer.json if you just want VS Code | ||
# and its sub-processes (terminals, tasks, debugging) to execute as the user. On Linux, | ||
# you may need to update USER_UID and USER_GID in .devcontainer/Dockerfile to match your | ||
# user if not 1000. See https://aka.ms/vscode-remote/containers/non-root for details. | ||
# user: node | ||
|
||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
|
||
volumes: | ||
- ..:/workspace:cached | ||
|
||
# Overrides default command so things don't shut down after the process ends. | ||
command: sleep infinity | ||
|
||
environment: | ||
- COUCH_HOST=cloudant | ||
- REDIS_HOST=redis | ||
|
||
links: | ||
- cache:redis | ||
- db:cloudant | ||
|
||
ports: | ||
- 3000:3000 | ||
|
||
db: | ||
image: ibmcom/cloudant-developer | ||
restart: unless-stopped | ||
ports: | ||
- 5984:80 | ||
|
||
cache: | ||
image: redis:5.0 | ||
ports: | ||
- 6379 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters