Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP docker migration #225

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ubuntu:22.04

RUN apt-get -y update && \
apt-get install -y sudo python3 python3-pip \
gcc git python3-dev libssl-dev libffi-dev \
python3-lxml apache2 libapache2-mod-wsgi-py3 \
mariadb-server python3-pymysql vim nano wget

RUN sudo pip3 install cffi cryptography Flask \
launchpadlib simplejson requests pytest \
python-dotenv

ADD --keep-git-dir=true https://github.com/openmainframeproject/software-discovery-tool.git /opt/software-discovery-tool

WORKDIR /opt/software-discovery-tool

RUN git submodule update --init --recursive --remote

RUN mv src/config/supported_distros.py.example src/config/supported_distros.py && \
mv .env.example .env

RUN git fetch && git checkout remotes/origin/data-update-fixes
RUN bash -c "echo 'export PYTHONPATH=/opt/software-discovery-tool/src/classes:/opt/software-discovery-tool/src/config:$PYTHONPATH' > /etc/profile.d/software-discovery-tool.sh"

RUN cp -f /opt/software-discovery-tool/src/config/sdt.conf /etc/apache2/sites-available/sdt.conf && \
mv /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/z-000-default.conf

RUN useradd -s /usr/bin/bash apache && \
chown -R apache:apache /opt/software-discovery-tool/

RUN a2dissite 000-default.conf && \
a2ensite sdt.conf

RUN apachectl restart

#USER apache
8 changes: 8 additions & 0 deletions bin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# check if every .example is renamed to original
# warn db hostname is localhost
#check if root password in env file has changed or not
# print if there are previous images in the system for sdt
# add instruction how to remove them
# docker build
# prep mariadb
# docker run
98 changes: 0 additions & 98 deletions src/setup/Dockerfile

This file was deleted.