-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (28 loc) · 977 Bytes
/
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
# Docker
FROM node:20.12.1
LABEL maintainer="Aanand Aman <aaman8@myseneca.ca>"
LABEL description="Fragments node.js microservice"
# We default to use port 8080 in our service
ENV PORT=8080
# Reduce npm spam when installing within Docker
# https://docs.npmjs.com/cli/v8/using-npm/config#loglevel
ENV NPM_CONFIG_LOGLEVEL=warn
# Disable colour when run inside Docker
# https://docs.npmjs.com/cli/v8/using-npm/config#color
ENV NPM_CONFIG_COLOR=false
# Use /app as our working directory
WORKDIR /app
# Option 1: explicit path - Copy the package.json and package-lock.json
# files into /app. NOTE: the trailing `/` on `/app/`, which tells Docker
# that `app` is a directory and not a file.
COPY package*.json /app/
# Install node dependencies defined in package-lock.json
RUN npm install
# Copy src/
COPY ./src ./src
# Copy our HTPASSWD file
COPY ./tests/.htpasswd ./tests/.htpasswd
# Run the server
CMD ["npm" ,"start"]
# We run our service on port 8080
EXPOSE 8080