Coder Social home page Coder Social logo

redis's Introduction

Redis Dockerfile

This repository contains Dockerfile of Redis for Docker's automated build published to the public Docker Hub Registry.

Base Docker Image

Installation

  1. Install Docker.

  2. Download automated build from public Docker Hub Registry: docker pull dockerfile/redis

    (alternatively, you can build an image from Dockerfile: docker build -t="dockerfile/redis" github.com/dockerfile/redis)

Usage

Run redis-server

docker run -d --name redis -p 6379:6379 dockerfile/redis

Run redis-server with persistent data directory. (creates dump.rdb)

docker run -d -p 6379:6379 -v <data-dir>:/data --name redis dockerfile/redis

Run redis-server with persistent data directory and password.

docker run -d -p 6379:6379 -v <data-dir>:/data --name redis dockerfile/redis redis-server /etc/redis/redis.conf --requirepass <password>

Run redis-cli

docker run -it --rm --link redis:redis dockerfile/redis bash -c 'redis-cli -h redis'

redis's People

Contributors

pilwon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redis's Issues

Redis doesn't connect with other image in docker

Hello, so i'm trying to run redis side by side a NestJS API, dockerize it and run it in an AWS instance
I tested it locally with my redis and local system, it works fine
But whenever i run my docker-compose up, i get the ERRCONFUSED error 127.0.0.1:6379
But if i run the nestjs container outside docker, it connects to the dockerized redis
Here is my docker-compose file

version: '3.3'
services:
  redis: # Name of container
    image: redis:6.2-alpine
    command: ["redis-server", "--bind", "0.0.0.0", "--port", "6379"]
    container_name: redis
    restart: unless-stopped
    network_mode: nebula
    expose:
      - 6379
    ports:
      - 6379:6379
  prod:
    container_name: ad-promoter-api-new-d
    image: ad-promoter-redis-prod-new-d:1.0.0
    build:
      context: .
      dockerfile: ./Dockerfile
      target: prod
    command: npm run start:prod
    ports:
      - 80:80
    network_mode: nebula
    links:
      - redis
    volumes:
      - .:/usr/src/app
      - /usr/src/app/node_modules
    restart: unless-stopped

Any help at all is appreciated

How to config redis if I wanted to?

FROM redis:3.2.11

RUN docker-entrypoint.sh

RUN redis-cli config get save

RUN redis-cli config set save ''

RUN redis-cli config get save

It is not working

Performance problem even with data directory

I have run the redis container with the following command, and I have already a running instance in Redis, The native redis runs 264270.62 queries per second whereas in container it runs 117744.02 queries per second. It is almost a 2.25x slow down, which makes using it questionable. What is the problem? Even the diff shows no change:

$ docker diff 6605
A /data


$ docker run -v /home/mustafa/redis-data:/data -d -p 9000:6379 dockerfile/redis
66058a4b3cdf6e2307cce43742b93c65c90575061d19f0a9cf8424790e3b642e
$ time redis-benchmark -t set -n 1000000 -p 6379
====== SET ======
  1000000 requests completed in 3.78 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

100.00% <= 0 milliseconds
264270.62 requests per second

real    0m3.852s
user    0m0.417s
sys 0m3.434s

$ time redis-benchmark -t set -n 1000000 -p 9000
====== SET ======
  1000000 requests completed in 8.49 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1

99.89% <= 1 milliseconds
100.00% <= 2 milliseconds
100.00% <= 2 milliseconds
117744.02 requests per second

real    0m8.562s
user    0m1.236s
sys 0m4.854s

Default location of data directory

I use docker-compose.yml version 3

  redis:
    container_name: redis
    image: redis:latest

I always use default setup in my Django application. And also docker layer.
Then to let my job persistant after IDC power down.
Could you show me the default location of it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.