Skip to content

Instantly share code, notes, and snippets.

View mhemrg's full-sized avatar

Mohammad Hossein Ebadollahi mhemrg

View GitHub Profile
@mhemrg
mhemrg / mongoose.js
Last active February 10, 2019 09:46
Connect to MongoDB in NodeJS with Mongoose | Liara
const mongoose = require('mongoose');
mongoose.connect('mongodb://root:[email protected]:PORT/cats_db', {
useNewUrlParser: true,
authSource: 'admin',
});
const Cat = mongoose.model('Cat', { name: String });
const kitty = new Cat({ name: 'Kitty' });
kitty.save().then(() => console.log('Cat added.'));
{
"volume": "/app/public"
}
@mhemrg
mhemrg / Dockerfile
Created February 14, 2019 19:31
Liara - NodeJS + FFMPEG
FROM jrottenberg/ffmpeg:4.0-ubuntu
FROM liararepo/node-platform
# Copy ffmpeg bins from first image
COPY --from=0 / /
@mhemrg
mhemrg / node.js
Created February 14, 2019 19:59
Liara | unhandledRejection
process.on('unhandledRejection', error => {
console.error('unhandledRejection', error);
process.exit(1);
});
@mhemrg
mhemrg / Dockerfile
Last active February 17, 2019 16:19
Liara + NodeJS Sharp package (libvips)
FROM creativearea/libvips:8.3.3-0
FROM liararepo/node-platform
RUN apt-get update && apt-get install -y build-essential curl
@mhemrg
mhemrg / Dockerfile
Created February 22, 2019 18:20
Liara - Extending Dockerfile
FROM liararepo/node-platform
RUN apt-get update && apt-get install -y PACKAGE
@mhemrg
mhemrg / Dockerfile
Last active February 28, 2019 16:06
Liara - Laravel platform without asset building
FROM thecodingmachine/php:7.2-v2-apache-node8
ENV APACHE_DOCUMENT_ROOT=/public \
TEMPLATE_PHP_INI=production \
LOG_CHANNEL=errorlog \
PHP_EXTENSIONS="amqp bcmath calendar exif gd gettext \
gmp gnupg igbinary imagick imap intl ldap mcrypt memcached \
mongodb pcntl pdo_dblib pdo_pgsql pgsql sockets yaml"
USER root
@mhemrg
mhemrg / liara.json
Created February 28, 2019 16:22
Liara - Liara.json
{
"platform": "docker",
"port": 80,
"project": "my-taak"
}
@mhemrg
mhemrg / .env
Created March 1, 2019 07:07
Liara - PHPMyAdmin environment variables
PMA_HOST=s1.liara.ir
PMA_PORT=31889
MYSQL_ROOT_PASSWORD=secret
PMA_ABSOLUTE_URI=https://test-phpmyadmin.liara.run
{
"port": 8000,
"platform": "docker"
}