-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile.production
52 lines (35 loc) · 1.12 KB
/
Dockerfile.production
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 ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
LABEL maintainer="[email protected]"
RUN apt update
RUN apt upgrade -y
#git && \
# rm -rf /var/lib/apt/lists/* && \
# apt clean
RUN apt install -y wget apt-transport-https gnupg curl sudo tmux emacs nano htop maven git less nginx tzdata
RUN ln -fs /usr/share/zoneinfo/Europe/Stockholm /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get update
RUN apt install -y nodejs
RUN npm -g install yarn
RUN useradd -ms /bin/bash bubify
RUN usermod -aG sudo bubify
RUN echo "bubify ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
WORKDIR /home/bubify
USER bubify
RUN mkdir -p frontend
RUN mkdir -p frontend/build
RUN mkdir -p frontend/node_modules
WORKDIR /home/bubify
RUN openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 \
-subj "/C=/ST=/L=/O=/CN=locahost" \
-keyout ssl.key -out ssl.crt
COPY ./ /home/bubify/frontend
WORKDIR /home/bubify/frontend
USER root
RUN rm -rf build
ENV PRODUCTION=true
USER bubify
CMD ["bash", "start_production.sh"]