Skip to content

Instantly share code, notes, and snippets.

@staskolukasz
staskolukasz / macos_postgres_docker_ruby_on_rails.md
Last active November 10, 2024 22:40
MacOS + Postgres + Docker + Ruby on Rails

The main goal of this gist is to demonstrate how to set up a PostgreSQL container and enable a Ruby on Rails application to connect to the database via PostgreSQL running in Docker.

  1. Create docker-compose.yml file:
services:
  postgres:
    image: postgres:14-alpine
    restart: always 
    ports:
@staskolukasz
staskolukasz / Dockerfile
Last active February 22, 2019 08:55
Sample docker file for Node.js application
FROM node:10.13.0-alpine
WORKDIR /usr/app
COPY package.json .
COPY package-lock.json .
COPY index.js .
RUN npm install && npm cache clean --force
@staskolukasz
staskolukasz / package.json
Last active February 21, 2019 08:51
Simple "npm run start" command
...
"scripts": {
"start": "node index.js"
}
...
@staskolukasz
staskolukasz / index.js
Created February 21, 2019 08:33
Sample Node.js application
const express = require('express');
const app = express();
const port = 3000;
app.get('/', (_, res) => {
res.send('Hello world!');
});
app.listen(port, () => {