forked from fleetbase/socket
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (23 loc) · 667 Bytes
/
Dockerfile
File metadata and controls
30 lines (23 loc) · 667 Bytes
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
FROM node:16-slim
RUN apt-get update -y --fix-missing \
&& apt-get upgrade -y \
&& apt-get install -y git
WORKDIR /app
RUN adduser --system www && chown -R www /app
USER www
# copy this first to not reinstall everything on a random file change
COPY socket/package.json ./
RUN npm install
# put the installed bin into PATH
RUN echo 'export PATH=$PATH:$(npm bin)' >> ~/.profile
SHELL ["/bin/sh", "-cl"]
COPY ./socket ./
# here we can pass args during build stage
ARG ENVIRONMENT=production
# and use the ARG as an env var
ENV ENV=$ENVIRONMENT
CMD npm run start
USER root
ENV SOCKETCLUSTER_PORT=8000
ENV SOCKETCLUSTER_WORKERS=5
ENV SOCKETCLUSTER_BROKERS=5