Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@derianpt
derianpt / docker-compose.yml
Last active October 10, 2018 09:02
compose file
version: "3"
services:
web-server:
build: .
depends_on:
- database
ports:
- "4200:5000"
entrypoint: "tail -f /dev/null"
FROM golang:latest
# Install tools required for project (postgres, git, gcc, curl, glide) less
# likely to change, so put it up here to take advantage of cache
RUN apk add postgresql;\
apk add git; \
apk add build-base; \
apk add curl; \
curl https://glide.sh/get | sh;
# 1. Absoulute path
build: .
# 2. Relative path
build: ../path/to/app/
# 3. Git repo URL
build: https://github.com/docker/rootfs.git
# 4. Git repo URL with branch
@derianpt
derianpt / .env
Created October 16, 2018 09:08
.env for docker medium post part 2
POSTGRES_USER=postgres
POSTGRES_DB=mydb
database:
image: "postgres:alpine"
environment:
POSTGRES_USER: postgres
POSTGRES_DB: mydb
database:
image: "postgres:alpine"
environment:
- POSTGRES_USER
- POSTGRES_DB
@derianpt
derianpt / StacksAndQueues.go
Created November 3, 2018 04:12
LIFO Stack and FIFO Queue implementation in Go/Golang.
package main
import (
"errors"
"fmt"
)
func main() {
// test out queue
var queue Queue
@derianpt
derianpt / database-persisted.yml
Last active June 27, 2019 07:09
medium docker part 2
database:
image: "postgres:alpine"
environment:
POSTGRES_USER: postgres
POSTGRES_DB: mydb
ports:
- "4201:5432"
# persist to a named volume
volumes:
- server_db:/var/lib/postgresql/data
@derianpt
derianpt / final-compose.yml
Last active September 27, 2019 07:29
medium docker part 2 final compose file
version: "3"
services:
web-client:
build: https://github.com/youraccount/web-client.git
ports:
- "4210::5000"
entrypoint: "npm run dev"
web-server:
@derianpt
derianpt / Dockerfile
Last active April 22, 2020 04:52
front-end app
# Base image is Alpine with latest stable Node installed.
FROM node:alpine
# set working directory for subsequent commands
WORKDIR /front-end
# leverage build cache by copying npm package files first
COPY ./package*.json ./