-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (27 loc) · 936 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
FROM ubuntu:jammy AS base
ARG PICT_LOC
ARG PORT
ARG LOG_ENABLED
ARG LOG_FILE_PATH
ARG CI
ENV NODE_VERSION=20.16.0
ENV NVM_DIR=/root/.nvm
ENV NODE_ENV=production
RUN apt-get update && apt-get install -y curl build-essential && apt-get clean
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN node --version && npm --version
# add stuff
WORKDIR /app/pwtg
COPY ./backend/binaries/pict ./binaries/pict
RUN chmod +x ./binaries/pict
COPY ./backend/package.json ./package.json
COPY ./backend/src ./src
COPY ./backend/tsconfig.json ./tsconfig.json
# install packages and build
RUN npm install && npm run build
EXPOSE ${PORT}
CMD ["node", "./dist/index.js"]