support local development with docker
This commit is contained in:
parent
7af2ff20a8
commit
61c32ee175
|
@ -0,0 +1,10 @@
|
||||||
|
FROM node:latest
|
||||||
|
|
||||||
|
ENV APP_PATH /opt/outline
|
||||||
|
RUN mkdir -p $APP_PATH
|
||||||
|
|
||||||
|
WORKDIR $APP_PATH
|
||||||
|
COPY . $APP_PATH
|
||||||
|
RUN yarn
|
||||||
|
RUN cp -r /opt/outline/node_modules /opt/node_modules
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
up:
|
||||||
|
docker-compose up -d redis postgres s3
|
||||||
|
docker-compose run --rm outline yarn sequelize db:migrate
|
||||||
|
docker-compose up outline
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker-compose build --pull outline
|
||||||
|
|
||||||
|
destroy:
|
||||||
|
docker-compose stop
|
||||||
|
docker-compose rm -f
|
||||||
|
|
||||||
|
.PHONY: up build destroy # let's go to reserve rules names
|
|
@ -0,0 +1,37 @@
|
||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
postgres:
|
||||||
|
image: postgres
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: user
|
||||||
|
POSTGRES_PASSWORD: pass
|
||||||
|
POSTGRES_DB: outline
|
||||||
|
s3:
|
||||||
|
image: lphoward/fake-s3
|
||||||
|
ports:
|
||||||
|
- "4569:4569"
|
||||||
|
outline:
|
||||||
|
image: outline:v001
|
||||||
|
command: yarn dev
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
args:
|
||||||
|
pull: 1
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
volumes:
|
||||||
|
- .:/opt/outline
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
- redis
|
||||||
|
- s3
|
||||||
|
environment:
|
||||||
|
NODE_PATH: "/opt/outline/node_modules:/opt/node_modules"
|
||||||
|
PATH: "/opt/outline/node_modules/.bin:/opt/node_modules/.bin:$PATH"
|
Reference in New Issue