-
-
Notifications
You must be signed in to change notification settings - Fork 117
/
Dockerfile
53 lines (34 loc) · 1.15 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
FROM node:20-alpine
RUN apk add --no-cache git openssh openssh-keygen openssl
# SSH setup
ARG SSH_KEY
ENV SSH_KEY=$SSH_KEY
RUN mkdir -p /root/.ssh && \
chmod 700 /root/.ssh
# Create id_rsa from string arg, and set permissions
RUN echo "$SSH_KEY" > /root/.ssh/id_rsa && \
chmod 600 /root/.ssh/id_rsa
# RUN eval $(ssh-agent -s)
RUN echo "$SSH_KEY" > /root/.ssh/id_rsa
# RUN echo " IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config
# RUN echo -e "Host github.com\n HostName github.com\n User git\n IdentityFile ~/.ssh/id_rsa" > /etc/ssh/ssh_config
# RUN echo -e "Host github.com\n HostName github.com\n User git\n IdentityFile ~/.ssh/id_rsa" > ~/.ssh/config
# RUN chmod 600 ~/.ssh/id_rsa
# Create known_hosts
RUN touch /root/.ssh/known_hosts
# Add git providers to known_hosts
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
# RUN ssh-keyscan bitbucket.org >> /root/.ssh/known_hosts
# RUN ssh-keyscan gitlab.com >> /root/.ssh/known_hosts
# test
# RUN ssh -T [email protected]
## ---
WORKDIR /usr/src/app
COPY package*.json ./
COPY yarn.lock ./
COPY tsconfig.json ./
COPY src ./src
COPY static ./static
RUN yarn
EXPOSE 3000
CMD ["yarn", "dev"]