-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
67 lines (51 loc) · 1.49 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
## Setting base OS layer
## docker build -t container_tag --build-arg IMAGE_SOURCE=node IMAGE_TAG=lts-alpine .
ARG IMAGE_SOURCE=node
ARG IMAGE_TAG=lts-alpine
FROM $IMAGE_SOURCE:$IMAGE_TAG
MAINTAINER Alexander Rogalskiy <@AlexRogalskiy>
## Setting arguments
ARG VERSION="0.0.0-dev"
ARG VCS_REF="$(date -u +\"%Y-%m-%dT%H:%M:%SZ\")"
ARG BUILD_DATE="$(git rev-parse --short HEAD)"
ARG HOME_DIR="/usr/src/app"
## Vercel token
ARG TOKEN
## Setting metadata
LABEL version=$VERSION
LABEL vcs-ref=$VCS_REF
LABEL build-date=$BUILD_DATE
LABEL name="Styled Code Formats"
LABEL description="Automatically generate styled formatted code (png, jpeg) upon request"
LABEL repository="https://github.com/AlexRogalskiy/code-formats"
LABEL homepage="https://github.com/AlexRogalskiy"
LABEL maintainer="Nullables, Inc. <[email protected]> (https://nullables.io)"
## Setting environment variables
ENV HOME $HOME_DIR
ENV LC_ALL en_US.UTF-8
ENV LANG $LC_ALL
ENV VERCEL_TOKEN $TOKEN
## Installing dependencies
RUN apk add --no-cache git
## Installing vercel
RUN npm i -g vercel
## Creating work directory
WORKDIR $HOME
## Copying project sources
COPY .vercel*/ ./.vercel
COPY api/ ./api
COPY src/ ./src
COPY typings/ ./typings
COPY favicon.ico .
COPY .env-cmdrc.json .
COPY vercel.json .
COPY package.json .
## Installing project dependencies
RUN npm install
RUN yes | vercel --confirm --token $VERCEL_TOKEN
## Setting volumes
VOLUME /tmp
## Exposing ports
EXPOSE 3000
## Running package bundle
CMD ["npm", "run", "develop:docker"]