Skip to content

Instantly share code, notes, and snippets.

@jrussellsmyth
Last active October 10, 2024 15:23
Show Gist options
  • Select an option

  • Save jrussellsmyth/97d8b77adb9307d1c9d2f4785056d21b to your computer and use it in GitHub Desktop.

Select an option

Save jrussellsmyth/97d8b77adb9307d1c9d2f4785056d21b to your computer and use it in GitHub Desktop.
service to include in a docker compose file to create a devcontainer for go development
go-service:
image: mcr.microsoft.com/devcontainers/go:1.22-bookworm
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '2'
memory: 2G
init: true
shm_size: '1gb'
# environment:
# - "ENV VARS HERE"
# ALLOW FOR PTRACE DEBUGGER
cap_add:
- SYS_PTRACE
security_opt:
- seccomp:unconfined
# depends_on:
# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"
volumes:
- $PWD:$PWD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment