forked from AudiusProject/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (58 loc) · 1.74 KB
/
Dockerfile
File metadata and controls
73 lines (58 loc) · 1.74 KB
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
FROM node:14.16 as builder
RUN apt-get install make
WORKDIR /app
COPY package*.json ./
RUN npm install --loglevel verbose
FROM alpine:3.13
WORKDIR /usr/src/app
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.10/main' >> /etc/apk/repositories && \
apk update && \
apk add bash && \
apk add nodejs && \
apk add npm && \
apk add redis && \
apk add sudo && \
apk add docker && \
apk add go-ipfs && \
apk add rsyslog && \
apk add libpq=11.12-r0 && \
apk add postgresql=11.12-r0 && \
apk add postgresql-client=11.12-r0 && \
apk add postgresql-contrib=11.12-r0 && \
apk add postgresql-libs=11.12-r0
# versions
# bash 5.1.0-r0
# docker 20.10.3-r1
# go-ipfs 0.8.0-r0
# nodejs 14.17.4-r0
# redis 6.0.14-r0
# sudo 1.9.5p2-r0
# rsyslog 8.2012.0-r1
# libpq 11.12-r0
# postgresql 11.12-r0
# postgresql-client 11.12-r0
# postgresql-contrib 11.12-r0
# postgresql-libs 11.12-r0
COPY --from=builder /app/node_modules ./node_modules
COPY . .
# Add the wait script to the image
# Script originally from https://github.com/ufoscout/docker-compose-wait/releases/download/2.4.0/wait /usr/bin/wait
COPY scripts/wait /usr/bin/wait
RUN chmod +x /usr/bin/wait
# Compile js code to typescript based on tsconfig.json
RUN ./node_modules/.bin/tsc --project ./
# Create a db user if postgres in case it will be run inside this container
RUN bash scripts/init-db.sh
VOLUME "/file_storage"
ENV storagePath=/file_storage
EXPOSE 8000
ARG git_sha
ARG audius_loggly_disable
ARG audius_loggly_token
ARG audius_loggly_tags
ENV GIT_SHA=$git_sha
ENV logglyDisable=$audius_loggly_disable
ENV logglyToken=$audius_loggly_token
ENV logglyTags=$audius_loggly_tags
# CMD ["sh", "-c", "/usr/bin/wait && exec node src/index.js"]
CMD ["bash", "scripts/start.sh"]