-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_Management
58 lines (44 loc) · 1.33 KB
/
Dockerfile_Management
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Build UI stage
# redirectory-hyperscan
# -----------
FROM redirectory_hyperscan_base:latest as management_ui_builder
# Set a few vars to help later on
ENV WORKDIR=/redirectory-ui-build
ENV FRONTENDDIR=$WORKDIR/frontend
ENV BUILDDIR=$WORKDIR/frontend/dist/spa
# Update packages and install needed dependacies to build the UI
RUN apt-get update
# Install Node JS and NPM
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
apt-get install -y nodejs
# Set workdir and copy the project
WORKDIR $WORKDIR
COPY . .
RUN cd $FRONTENDDIR && \
npm install && \
npm install -g @quasar/cli && \
quasar build
# Real stage
# ----------
FROM redirectory_hyperscan_base:latest
# Create work directory and copy the project
WORKDIR /redirectory
# Data and UI folders for the application
RUN mkdir /redirectory_data && \
mkdir /redirectory_ui && \
mkdir /redirectory_config
# Install something for sqlalchemy
RUN apt-get update && \
apt-get install -y default-libmysqlclient-dev
COPY . .
# Install all needed dependencies
RUN pip3 install --upgrade pip && \
pip3 install -r requirements.txt
# Copy UI from ui build stage
COPY --from=management_ui_builder /redirectory-ui-build/frontend/dist/spa /redirectory_ui
# Expose normal port
EXPOSE 8001
# Expose metrics port
EXPOSE 8002
# Run
CMD ["python3", "-m", "redirectory"]