Skip to content

Instantly share code, notes, and snippets.

@strass
Created November 5, 2019 18:42
Show Gist options
  • Save strass/70ede5f91e0e3fb8ab92da47fe9e085e to your computer and use it in GitHub Desktop.
Save strass/70ede5f91e0e3fb8ab92da47fe9e085e to your computer and use it in GitHub Desktop.
{
"name": "Espresso Dev",
"dockerComposeFile": ["./docker-compose.yml"],
"service": "espresso-dev",
"workspaceFolder": "/home/developer/espresso",
"settings": {
"terminal.integrated.shell.linux": null
},
"runServices": ["caddy"],
"extensions": [],
}
version: '3'
services:
espresso-dev:
user: developer
build:
context: .
dockerfile: ./Dockerfile
volumes:
- ..:/home/developer/espresso
tty: true
stdin_open: true
networks:
internal-network:
aliases: # alias both so we can use the staging caddyfile
- 'frontend'
- 'backend'
caddy:
image: abiosoft/caddy:1.0.3-no-stats
volumes:
- .:/root/.caddy
- ../deployment/staging/Caddyfile:/etc/Caddyfile
ports:
- '2015:2015'
- '80:80'
- '443:443'
depends_on:
- espresso-dev
networks:
outside-world:
internal-network:
networks:
internal-network:
internal: true
outside-world:
FROM python:3.7-buster
ARG USERNAME=developer
# On Linux, replace with your actual UID, GID if not the default 1000
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN echo "Starting Build" \
&& 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* \
# Install node prereqs
# Ref: https://deb.nodesource.com/setup_12.x
&& echo "deb https://deb.nodesource.com/node_12.x buster main" > /etc/apt/sources.list.d/nodesource.list \
&& wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
&& apt-get update \
&& apt-get install -yqq nodejs sudo zsh locales fonts-powerline \
&& pip install -U pip && pip install pipenv \
&& npm i -g npm@^6 \
&& rm -rf /var/lib/apt/lists/* \
&& locale-gen en_US.UTF-8 \
# Add sudo support
&& usermod -aG sudo $USERNAME \
&& echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
# ZSH
&& wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true
USER $USERNAME
ENV TERM xterm
ENV ZSH_THEME agnoster
WORKDIR /home/developer/espresso
ENTRYPOINT ["/bin/zsh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment