-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
75 lines (54 loc) · 1.47 KB
/
Dockerfile
File metadata and controls
75 lines (54 loc) · 1.47 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Configure the"build" image
FROM ubuntu:18.04 AS BUILD_IMAGE
# Get the updates
RUN apt-get update -y
#COPY set working directory
RUN mkdir -p /app
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
RUN apt-get install nodejs -y
RUN apt-get install -y npm
RUN npm install -g npm@latest
COPY package.json ./
COPY .env ./
COPY echo.json ./
RUN npm install
RUN mkdir -p ./public
COPY public ./public
RUN mkdir -p ./src
COPY src ./src
RUN set NODE_OPTIONS="--max-old-space-size=4096"
ENV GENERATE_SOURCEMAP=false
RUN npm run build
# Now configure the executable image
FROM ubuntu:18.04
# Get the updates
RUN apt-get update -y
# Install and configure Apache
RUN apt-get install apache2 -y
WORKDIR /etc/apache2
RUN a2enmod headers
COPY config/apache2.conf .
COPY config/ports.conf .
WORKDIR /etc/apache2/sites-available
COPY config/clockwerxWeb.conf .
WORKDIR /var/www
RUN mkdir -p clockwerxWeb
WORKDIR /var/www/clockwerxWeb
RUN chmod -R 777 .
RUN mkdir -p logs
RUN chmod 777 logs
WORKDIR /etc/apache2/sites-available
RUN a2dissite 000-default
RUN a2ensite clockwerxWeb.conf
RUN apt-get install supervisor -y
RUN mkdir -p /var/log/supervisor
RUN mkdir -p /etc/supervisor/conf.d
COPY config/supervisor.conf /etc/conf.d/supervisor.conf
# Copy the build artifacts to the deployment folder
WORKDIR /
COPY --from=BUILD_IMAGE /app/build /var/www/clockwerxWeb
WORKDIR /
RUN alias python=python3
CMD ["supervisord", "-c", "/etc/conf.d/supervisor.conf"]