-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (20 loc) · 1.02 KB
/
Dockerfile
File metadata and controls
30 lines (20 loc) · 1.02 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
# Start with the latest Node.js LTS release
FROM --platform=linux/amd64 node:10
# Set an env variable for the location of the app files
ENV APP_HOME=/opt/node/app
# update path to include any installed node module executables
RUN echo "export PATH=$APP_HOME/node_modules/.bin:\$PATH\n" >> /root/.bashrc
RUN echo "deb http://archive.debian.org/debian/ stretch main non-free contrib\ndeb http://archive.debian.org/debian-security/ stretch/updates main non-free contrib" > /etc/apt/sources.list
RUN wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - && \
echo "deb http://apt-archive.postgresql.org/pub/repos/apt/ stretch-pgdg main" >> /etc/apt/sources.list.d/pgdg.list && \
apt-get update -y && \
apt-get install -y postgresql-client-11
# Create a directory for the server app to run from
RUN mkdir -p $APP_HOME
# Add the project files into the app directory and set as working directory
ADD . $APP_HOME
WORKDIR $APP_HOME
RUN npm install
RUN npm run build:prod
EXPOSE 3000
CMD ["node", "./bin/www"]