Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kutt 4/sign up removal #2

Merged
merged 3 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.env
.git
node_modules
production-server
2 changes: 1 addition & 1 deletion .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ REDIS_PORT=6379
REDIS_PASSWORD=

# Disable registration
DISALLOW_REGISTRATION=false
DISALLOW_REGISTRATION=true

# Disable anonymous link creation
DISALLOW_ANONYMOUS_LINKS=false
Expand Down
24 changes: 24 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:12-alpine

RUN apk add --update bash

# Setting working directory.
WORKDIR /usr/src/app

# Installing dependencies
COPY package*.json ./
RUN npm install

# Copying source files
COPY . .

# Give permission to run script
RUN chmod +x ./wait-for-it.sh

# Build files
RUN npm run build

EXPOSE 3000

# Running the app
CMD [ "npm", "start" ]
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
DOCKER_USERNAME?=mconf
REPOSITORY?=kutt
IMAGE_NAME=$(DOCKER_USERNAME)/$(REPOSITORY)
REVISION?=$(shell git rev-parse --short HEAD)

up-dev:
docker-compose -f dev.yml up

up:
docker-compose up

docker-build-dev:
docker build --rm -f Dockerfile.dev -t $(IMAGE_NAME):dev-latest --build-arg git_token=$(GIT_TOKEN) .
37 changes: 37 additions & 0 deletions dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: "3"

services:
mconf-kutt-dev:
image: mconf/kutt:dev-latest
depends_on:
- postgres
- redis
command: ["./wait-for-it.sh", "postgres:5432", "--", "npm", "start"]
ports:
- "3000:3000"
env_file:
- .env
environment:
DB_HOST: postgres
DB_NAME: kutt
DB_USER: user
DB_PASSWORD: pass
REDIS_HOST: redis

redis:
image: redis:6.0-alpine
volumes:
- redis_data:/data

postgres:
image: postgres:12-alpine
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_DB: kutt
volumes:
- postgres_data:/var/lib/postgresql/data

volumes:
redis_data:
postgres_data: