forked from PhlexPlexico/G5API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (38 loc) · 1.29 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
FROM redis:latest
USER root
# api port
EXPOSE 3301
# update and install initial packages
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
curl \
apt-transport-https \
lsb-release \
gnupg \
git
# add yarn repo
RUN curl https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
# install nvm and node 13.8.0
SHELL ["/bin/bash", "--login", "-c"]
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
RUN nvm install 14.17.5
# install yarn
RUN apt-get update && apt-get install --no-install-recommends -y \
yarn
# clone and move into Get5API folder
RUN mkdir /Get5API
RUN mkdir /etc/redis
WORKDIR /Get5API/G5API
COPY . .
# copy production and redis into place
RUN cp /Get5API/G5API/config/production.json.template /Get5API/G5API/config/production.json
RUN cp /Get5API/G5API/config/redis.conf /etc/redis/redis.conf
# set config with env variables, build, and run application
CMD sh /Get5API/G5API/config/setEnv.sh && \
yarn install --production && \
yarn migrate-create-prod && \
yarn migrate-prod-upgrade && \
yarn && \
redis-server /etc/redis/redis.conf --daemonize yes --appendonly yes && \
yarn startprod && \
yarn pm2 logs