-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_Multistage
72 lines (69 loc) · 3 KB
/
Dockerfile_Multistage
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
# Copyright (C) <2022-2023> <Akshat Singh>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This is a Dockerfile for trac
FROM quay.io/official-images/debian:bullseye-slim AS build
LABEL description="Custom httpd container image for running trac"
MAINTAINER Akshat Singh <[email protected]>
ARG MARIADB_USER=db_user
ARG MARIADB_ROOT_PASSWORD=db_pw
ARG TRAC_USER=trac_user
ARG TRAC_PASSWORD=trac_pw
ARG TRAC_PROJECT_NAME=trac_project_name
ARG MARIADB_DATABASE=db_name
ARG MARIADB_HOST=db_host
ARG MARIADB_PORT=db_port
ENV MARIADB_USER=$MARIADB_USER \
MARIADB_ROOT_PASSWORD=$MARIADB_ROOT_PASSWORD \
MARIADB_DATABASE=$MARIADB_DATABASE \
MARIADB_HOST=$MARIADB_HOST \
MARIADB_PORT=$MARIADB_PORT \
TRAC_USER=$TRAC_USER \
TRAC_PASSWORD=$TRAC_PASSWORD \
TRAC_PROJECT_NAME=$TRAC_PROJECT_NAME \
TRAC_LOCATION=/usr/local/trac \
LogLevel="info"
RUN apt-get update \
&& apt-get install -y wget git apache2 apache2-utils apache2-dev libcap2-bin python2 python2-dev python-is-python2 mariadb-client default-libmysqlclient-dev subversion
RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py \
&& python2 get-pip.py
RUN python2 -m pip install setuptools Jinja2 babel Pygments docutils pytz textile PyMySQL trac TracTags genshi mod_wsgi
RUN python2 -m pip install svn+https://trac-hacks.org/svn/tocmacro/0.11
RUN a2enmod lbmethod_byrequests
RUN apt-get purge -y subversion
#&& setcap 'cap_net_bind_service=+ep' /usr/sbin/apache2
#ADD trac.conf /etc/apache2/sites-available/trac.conf
COPY db/dumps/trac_ComputingDocs_19Jul23.sql /opt/akstrac/db_backup/trac_ComputingDocs.sql
COPY configs/trac.conf /opt/akstrac/trac.conf
COPY configs/ports.conf /opt/akstrac/ports.conf
COPY configs/trac.ini_customization /opt/akstrac/trac.ini_customization
COPY configs/ComputingDocs.wsgi /opt/akstrac/ComputingDocs.wsgi
COPY configs/theme.html /opt/akstrac/theme.html
COPY images /opt/akstrac/images
COPY git/UsefulScripts /opt/akstrac/UsefulScripts
COPY ./entrypoint.sh /opt/akstrac/entrypoint.sh
WORKDIR /opt/akstrac
RUN chmod -R 777 /usr/local \
&& chmod -R 777 /opt/akstrac \
&& chmod -R 777 /etc/apache2 \
&& chmod -R 777 /var/run \
&& chmod -R 777 /var/log/apache2 \
&& chmod -R 777 /var/lock \
&& chmod 777 /opt/akstrac/entrypoint.sh
USER 1001
FROM quay.io/jitesoft/alpine
COPY --from=build /opt/akstrac /opt/akstrac
EXPOSE 8080
ENTRYPOINT ["./entrypoint.sh"]