Skip to content

Instantly share code, notes, and snippets.

@gnschenker
gnschenker / docker-compose.yml
Created October 4, 2019 08:15
Step 1: docker-compose.yml file
version: "2.4"
services:
db:
image: postgres:12.0-alpine
volumes:
- pg-data:/var/lib/postgresql/data
- ./db/init:/docker-entrypoint-initdb.d
ports:
- 5432
environment:
kafka-console-consumer \
--bootstrap-server kafka:9092 \
--topic demo-topic \
--from-beginning
kafka-console-producer \
--broker-list kafka:9092 \
--topic demo-topic
kafka-topics --bootstrap-server kafka:9092 \
--create \
--topic demo-topic \
--partitions 3 \
--replication-factor 1
@gnschenker
gnschenker / docker-compose.yml
Created October 1, 2019 12:58
docker-compose.yml for Health Checks Sample
version: "2.3"
services:
zookeeper:
image: confluentinc/cp-zookeeper:5.3.0
hostname: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
@gnschenker
gnschenker / debugging-in-vscode.adoc
Last active July 18, 2020 19:52
Line-by-line debugging .NET Core app running in Docker container using VS Code

Configuring VS Code for Debugging

Here is how to configure VS Code for line-by-line debugging a .NET Core 2.1 application in a Docker container

  1. Start microsoft/dotnet:2.1-sdk interactively

    docker run --rm -it \
        -v ${PWD}:/app \
FROM python:2.7
RUN mkdir -p /app
WORKDIR /app
COPY requirements.txt /app/
# for debugging purposes
COPY ./pycharm-debug.egg /app/
RUN pip install -r requirements.txt
COPY . /app
from flask import Flask, jsonify
app = Flask(__name__)
tasks = [
{
'id': 1,
'title': u'Buy groceries',
'description': u'Milk, Cheese, Pizza, Fruit, Tylenol',
FROM python:2.7
RUN mkdir -p /app
WORKDIR /app
COPY requirements.txt /app/
RUN pip install -r requirements.txt
# for debugging purposes
RUN pip install ptvsd
COPY . /app
@gnschenker
gnschenker / launch.json
Created November 27, 2016 04:36
Launch configuration
{
"name": "Attach (Remote Debug)",
"type": "python",
"request": "attach",
"localRoot": "${workspaceRoot}",
"remoteRoot": "${workspaceRoot}",
"port": 3000,
"secret": "my_secret",
"host": "localhost"
}