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

WIP: Интеграция #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
15 changes: 15 additions & 0 deletions dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Development

Запуск приложения

```
docker-compose up
```

Либо запускаем по одному - заходим в нужную папку и делаем

```
make build
make run
```
В `Makefile` если что можно посмотреть какие есть ещё команды для `make`-а.
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '2'
services:
frontend:
build: front
ports:
- "8080:8080"
python:
build: python
ports:
- "5000:5000"
28 changes: 28 additions & 0 deletions front/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#FROM python:3-alpine
FROM ubuntu:18.04

ARG BUILD_DATE
ARG VCS_REF

# Set labels (see https://microbadger.com/labels)
LABEL org.label-schema.build-date=$BUILD_DATE

RUN mkdir -p /app
WORKDIR /app

RUN apt-get update && apt-get install -y npm nodejs curl
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
RUN npm install
#RUN export NVM_DIR="$HOME/.nvm"
#RUN [ -s "~/.nvm/nvm.sh" ] && \. "~/.nvm/nvm.sh"
#RUN nvm install 8.4.0
#RUN nvm use 8.4.0
#RUN npm install -g [email protected]
#COPY package*.json /app/
#RUN npm install
#RUN npm run dev
COPY . /app

EXPOSE 8080

CMD ["npm", "run", "dev"]
31 changes: 31 additions & 0 deletions front/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.PHONY: clean build run stop inspect

IMAGE_NAME = markdown-ide-front
CONTAINER_NAME = markdown-ide-front

build:
docker build -t $(IMAGE_NAME) .

release:
docker build \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` -t $(IMAGE_NAME) .

run:
docker run --rm -p 8080:8080 --name $(CONTAINER_NAME) $(IMAGE_NAME)

inspect:
docker inspect $(CONTAINER_NAME)

shell:
docker exec -it $(CONTAINER_NAME) /bin/bash

stop:
docker stop $(CONTAINER_NAME)

clean:
docker ps -a | grep '$(CONTAINER_NAME)' | awk '{print $$1}' | xargs docker rm \
docker images | grep '$(IMAGE_NAME)' | awk '{print $$3}' | xargs docker rm



2 changes: 1 addition & 1 deletion front/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
proxyTable: {},

// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
host: '0.0.0.0', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
Expand Down
7 changes: 1 addition & 6 deletions python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
#FROM python:3-alpine
FROM ubuntu:18.04
MAINTAINER Niko Schmuck <[email protected]>

ARG BUILD_DATE
ARG VCS_REF

# Set labels (see https://microbadger.com/labels)
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/nikos/python3-alpine-flask-docker"

LABEL org.label-schema.build-date=$BUILD_DATE

RUN mkdir -p /app
WORKDIR /app
Expand Down
4 changes: 2 additions & 2 deletions python/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: clean build run stop inspect

IMAGE_NAME = markdown_ide/markdown_ide
CONTAINER_NAME = flask-markdown-ide
IMAGE_NAME = markdown_ide/python
CONTAINER_NAME = markdown-ide-python

build:
docker build -t $(IMAGE_NAME) .
Expand Down