This repository has been archived by the owner on Feb 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (38 loc) · 1.51 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
###############################################################################################
# Base
###############################################################################################
FROM node:18 as smssender-base
RUN mkdir -p /app
WORKDIR /app
RUN mkdir -p /docker
RUN apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update
RUN apt-get install dos2unix -y
###############################################################################################
# DEVELOPMENT
###############################################################################################
FROM smssender-base as smssender-dev
RUN mkdir -p /docker
COPY ./docker/entrypoint.sh /docker
# required for commits within vscode
RUN apt-get install git gnupg openssh-client -y
RUN chmod +x /docker/entrypoint.sh
RUN dos2unix /docker/entrypoint.sh
# publish app
EXPOSE 3000
ENTRYPOINT [ "/docker/entrypoint.sh" ]
###############################################################################################
# PRODUCTION
###############################################################################################
FROM smssender-base as smssender-deploy
# Install app dependencies
COPY . .
RUN npm install
RUN npm run build
COPY ./docker/entrypoint.prod.sh /docker
COPY ./docker/set_env_secrets.sh /docker
RUN chmod +x /docker/entrypoint.prod.sh
RUN chmod +x /docker/set_env_secrets.sh
RUN dos2unix /docker/entrypoint.prod.sh
RUN dos2unix /docker/set_env_secrets.sh
EXPOSE 3000
ENTRYPOINT [ "/docker/entrypoint.prod.sh" ]