Skip to content
This repository was archived by the owner on Apr 12, 2022. It is now read-only.

Commit 4acb00e

Browse files
committed
add Dockerfile
1 parent 8fb43d4 commit 4acb00e

File tree

4 files changed

+132
-0
lines changed

4 files changed

+132
-0
lines changed

.dockerignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# add git-ignore syntax here of things you don't want copied into docker image
2+
3+
node_modules
4+
npm-debug.log
5+
Dockerfile*
6+
docker-compose*
7+
.dockerignore
8+
.git
9+
.gitignore
10+
README.md
11+
LICENSE
12+
.vscode

Dockerfile.automator

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
FROM node:12-stretch
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
4+
5+
# Install dependencies
6+
RUN apt-get update \
7+
&& apt-get install -y --no-install-recommends apt-utils \
8+
&& apt-get upgrade -y \
9+
&& apt-get install -y --no-install-recommends python python-dev python-pip build-essential cmake git pkg-config libjpeg62-turbo-dev libtiff5-dev libpng-dev libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libatlas-base-dev gfortran libavresample-dev libgphoto2-dev libgstreamer-plugins-base1.0-dev libdc1394-22-dev \
10+
&& apt-get install -y cmake git pkg-config \
11+
&& apt-get install -y libboost-all-dev \
12+
&& apt-get install -y ffmpeg x264 x265 \
13+
&& apt-get install -y libjsoncpp-dev \
14+
&& apt-get install -y yarn \
15+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
16+
17+
# Build OpenCV
18+
RUN cd /opt \
19+
&& wget https://github.com/opencv/opencv/archive/3.4.0.zip -O opencv-3.4.0.zip
20+
RUN cd /opt && unzip opencv-3.4.0.zip \
21+
&& cd opencv-3.4.0 \
22+
&& mkdir build \
23+
&& cd build \
24+
&& cmake \
25+
-D CMAKE_BUILD_TYPE=RELEASE \
26+
-D CMAKE_INSTALL_PREFIX=/usr/local \
27+
-D INSTALL_C_EXAMPLES=OFF \
28+
-D INSTALL_PYTHON_EXAMPLES=OFF \
29+
-D BUILD_EXAMPLES=OFF /opt/opencv-3.4.0 \
30+
&& make -j $(nproc) \
31+
&& make install \
32+
&& ldconfig \
33+
&& rm -rf /opt/opencv*
34+
35+
# Build animeloop-cli
36+
RUN git clone https://github.com/moeoverflow/animeloop-cli.git \
37+
&& cd animeloop-cli \
38+
&& git submodule init && git submodule update \
39+
&& mkdir build && cd build \
40+
&& cmake .. \
41+
&& make animeloop-cli \
42+
&& cp /animeloop-cli/build/animeloop-cli /usr/bin \
43+
&& chmod +x /usr/bin/animeloop-cli
44+
45+
WORKDIR /usr/src/app
46+
47+
COPY . .
48+
COPY package*.json .
49+
50+
RUN yarn \
51+
&& yarn build
52+
53+
CMD ["yarn", "start:automator"]

Dockerfile.node

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM node:12-alpine
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY . .
6+
COPY package*.json .
7+
8+
RUN yarn \
9+
&& yarn build

docker-compose.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
version: '3'
2+
3+
services:
4+
animeloop-api:
5+
container_name: animeloop-api
6+
build:
7+
context: .
8+
dockerfile: ./Dockerfile.node
9+
ports:
10+
- 7775:7775
11+
networks:
12+
- postgres_default
13+
- redis_default
14+
volumes:
15+
- node_modules:/usr/src/app/node_modules
16+
- dist:/usr/src/app/dist
17+
command: yarn start:api
18+
animeloop-twitterbot:
19+
container_name: animeloop-twitterbot
20+
build:
21+
context: .
22+
dockerfile: ./Dockerfile.node
23+
networks:
24+
- postgres_default
25+
- redis_default
26+
volumes:
27+
- node_modules:/usr/src/app/node_modules
28+
- dist:/usr/src/app/dist
29+
command: yarn start:twitterbot
30+
animeloop-telegrambot:
31+
container_name: animeloop-telegrambot
32+
build:
33+
context: .
34+
dockerfile: ./Dockerfile.node
35+
networks:
36+
- postgres_default
37+
- redis_default
38+
volumes:
39+
- node_modules:/usr/src/app/node_modules
40+
- dist:/usr/src/app/dist
41+
command: yarn start:telegrambot
42+
# animeloop-automator:
43+
# container_name: animeloop-automator
44+
# build:
45+
# context: .
46+
# dockerfile: ./Dockerfile.automator
47+
# networks:
48+
# - postgres_default
49+
# - redis_default
50+
# command: yarn start:automator
51+
volumes:
52+
node_modules:
53+
dist:
54+
networks:
55+
postgres_default:
56+
external: true
57+
redis_default:
58+
external: true

0 commit comments

Comments
 (0)