-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
50 lines (40 loc) · 1.01 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
# -------------------------------------------------------------------
# Minimal dockerfile from alpine base
#
# Instructions:
# =============
# 1. Create an empty directory and copy this file into it.
#
# 2. Create image with:
# docker build --tag timeoff:latest .
#
# 3. Run with:
# docker run -d -p 3000:3000 --name alpine_timeoff timeoff
#
# --------------------------------------------------------------------
FROM node:16-alpine
RUN apk update
#RUN apk upgrade
# Install dependencies
RUN apk add \
git \
make \
python3 \
g++ \
gcc \
libc-dev \
clang
WORKDIR /app
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.docker.cmd="docker run -d -p 3000:3000 --name alpine_timeoff"
# Cache the docker layer with the node_modules
COPY package.json /app/package.json
COPY package-lock.json /app/package-lock.json
RUN npm install -y
# Copy the application into the container.
COPY . /app
# Add user so it doesn't run as root
RUN adduser --system app --home /app
USER app
EXPOSE 3000
CMD npm start