-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
75 lines (57 loc) · 1.72 KB
/
Dockerfile
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM ubuntu as web
ARG PORT=4191
ARG VITE_APP_API_URL=http://localhost:4190
ENV PORT $PORT
ENV VITE_APP_API_URL $VITE_APP_API_URL
WORKDIR /app/web
COPY ./bin /app/bin
COPY ./web /app/web
RUN apt-get update && apt-get install -y curl
# VOLTA ---
SHELL [ "/bin/bash", "-c" ]
ENV PROFILE /app/bin/bashrc
ENV BASH_ENV /app/bin/bashrc
ENV VOLTA_HOME /app/bin/volta
ENV PATH $VOLTA_HOME/bin:$PATH
RUN touch /app/bin/bashrc && \
curl https://get.volta.sh | bash && \
/app/web/bin/build.sh
# ---
FROM mongo:latest as api
COPY --from=web /app/web/dist /app/web/dist
COPY --from=web /app/bin/*.sh /app/bin/
COPY --from=web /app/web/bin /app/web/bin
# Copy package.json for volta version
COPY --from=web /app/web/package.json /app/web/package.json
ARG PORT=4190
ARG DATABASE_URL=mongodb://localhost/the-clipping-project
ARG TEST_DATABASE_URL=mongodb://localhost/the-clipping-project-test
ARG API_URL=http://localhost:4190
ARG NODE_ENV=production
ENV PORT $PORT
ENV DATABASE_URL $DATABASE_URL
ENV TEST_DATABASE_URL $TEST_DATABASE_URL
ENV API_URL $API_URL
ENV NODE_ENV $NODE_ENV
RUN apt-get update && apt-get install -y ffmpeg python3 curl wget && \
wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp && \
chmod a+rx /usr/local/bin/yt-dlp
# VOLTA ---
SHELL [ "/bin/bash", "-c" ]
RUN touch /app/bin/bashrc
ENV PROFILE /app/bin/bashrc
ENV BASH_ENV /app/bin/bashrc
ENV VOLTA_HOME /app/bin/volta
ENV PATH $VOLTA_HOME/bin:$PATH
RUN touch /app/bin/bashrc && \
curl https://get.volta.sh | bash
# ---
EXPOSE 27017
COPY ./api /app/api/
WORKDIR /app/api
RUN /app/api/bin/build.sh
WORKDIR /app/web
RUN volta install node@14 && volta install serve
EXPOSE 4190 4191
WORKDIR /app
CMD ["/app/bin/start.sh"]