<commit_before># base dockerfile from <EMAIL>:cabildocl/web2py-docker.git
FROM nginx:1.19
MAINTAINER VARIA "<EMAIL>"

ENV CERT_PASS <PASSWORD>
ENV CERT_DOMAIN web2py.local
#password web2py admin
ENV PW admin
ARG BRANCH=master
ARG GITHUB_TOKEN
ARG LOCAL

EXPOSE 443 80 8000

RUN apt-get update && \
    apt-get install wget -y && \
    apt-get install unzip -y && \
    apt-get -y install python3 python3-pip && \
    pip3 install gunicorn mysql-connector-python

RUN apt-get install -y supervisor unzip git

WORKDIR /root

RUN wget https://mdipierro.pythonanywhere.com/examples/static/web2py_src.zip && \
	unzip web2py_src.zip && \
	rm web2py_src.zip

WORKDIR /root/web2py

RUN python3 -c "from gluon.main import save_password; save_password('$PW',80)" && \
	python3 -c "from gluon.main import save_password; save_password('$PW',<PASSWORD>)" && \
    python3 -c "from gluon.main import save_password; save_password('$PW',<PASSWORD>)"

# copy nginx config
ADD web2py /etc/nginx/conf.d/default.conf

RUN mkdir /certs

WORKDIR /certs

RUN openssl genrsa -passout pass:$CERT_PASS 2048 > web2py.key && \
    openssl req -new -x509 -nodes -sha1 -days 1780 -subj "/C=US/ST=Denial/L=Chicago/O=Dis/CN=$CERT_DOMAIN" -key web2py.key > web2py.crt && \
    openssl x509 -noout -fingerprint -text < web2py.crt > web2py.info

# add VARIA source, use /root as HOME
WORKDIR /root
COPY RandomMetroidSolver.tar.gz /root/RandomMetroidSolver.tar.gz
RUN if [ -n "${GITHUB_TOKEN}" ]; then \
    git clone --recurse-submodules -b ${BRANCH} https://${GITHUB_TOKEN}:x-oauth-basic@github.com/theonlydude/RandomMetroidSolver.git; \
elif [ "${LOCAL}" -eq 0 ]; then \
    mkdir RandomMetroidSolver; \
    cd RandomMetroidSolver; \
    tar zxf ../RandomMetroidSolver.tar.gz; \
else \
    wget https://github.com/theonlydude/RandomMetroidSolver/archive/${BRANCH}.zip && unzip ${BRANCH}.zip && mv RandomMetroidSolver-${BRANCH} RandomMetroidSolver && rm -f ${BRANCH}.zip; \
    cd RandomMetroidSolver; \
    rm -rf varia_custom_sprites && wget https://github.com/theonlydude/varia_custom_sprites/archive/main.zip && unzip main.zip && mv varia_custom_sprites-main varia_custom_sprites && rm -f main.zip; \
fi

# fetch race mode, only through github because private repo
RUN if [ -n "${GITHUB_TOKEN}" ]; then git clone https://${GITHUB_TOKEN}:x-oauth-basic@github.com/theonlydude/varia-race-mode; fi

# add communitry presets
WORKDIR /root/web2py
RUN mkdir -p /root/web2py/varia_repository
RUN wget https://github.com/theonlydude/community_presets/archive/master.zip && unzip master.zip && mv community_presets-master community_presets && rm -f master.zip

# add symbolic links and other web2py customization
RUN ln -s /root/RandomMetroidSolver/rando_presets /root/web2py/rando_presets
RUN ln -s /root/RandomMetroidSolver/standard_presets /root/web2py/standard_presets
RUN rm -f /web2py/routes.py && ln -s /root/RandomMetroidSolver/web/static/routes.py /root/web2py/routes.py
RUN mkdir -p /root/web2py/plandository /root/web2py/roms /root/web2py/applications/solver

WORKDIR /root/web2py/applications/solver
RUN mkdir cache  controllers  cron  databases  errors  languages  models  modules  private  sessions  static  uploads  views
RUN mkdir -p views/solver_web && touch views/solver_web/__init__.py
WORKDIR /root/web2py/applications/solver/static
RUN mkdir -p js graph fonts images/sprite_sheets css

# varia install
RUN /root/RandomMetroidSolver/web/install.sh
RUN /root/RandomMetroidSolver/varia_custom_sprites/install.sh
RUN if [ -n "${GITHUB_TOKEN}" ]; then VARIA_DIR=/root/RandomMetroidSolver /root/varia-race-mode/install.sh; fi

# add db conf
RUN echo "dbParams = dict(host='varia-mysql', user='varia', database='varia', password='<PASSWORD>', port=3306)" > /root/RandomMetroidSolver/db_params.py

# create empty database

WORKDIR /

COPY nginx.conf /etc/supervisor/conf.d/nginx.conf
COPY web2py.conf /etc/supervisor/conf.d/web2py.conf
CMD ["supervisord", "-n"]<commit_msg>remove local from Dockerfile in favor of Dockerfile.local<commit_after># base dockerfile from <EMAIL>:cabildocl/web2py-docker.git
FROM nginx:1.19
MAINTAINER VARIA "<EMAIL>"

ENV CERT_PASS <PASSWORD>
ENV CERT_DOMAIN web2py.local
#password web2py admin
ENV PW admin
ARG BRANCH=master
ARG GITHUB_TOKEN

EXPOSE 443 80 8000

RUN apt-get update && \
    apt-get install wget -y && \
    apt-get install unzip -y && \
    apt-get -y install python3 python3-pip && \
    pip3 install gunicorn mysql-connector-python

RUN apt-get install -y supervisor unzip git

WORKDIR /root

RUN wget https://mdipierro.pythonanywhere.com/examples/static/web2py_src.zip && \
	unzip web2py_src.zip && \
	rm web2py_src.zip

WORKDIR /root/web2py

RUN python3 -c "from gluon.main import save_password; save_password('$PW',80)" && \
	python3 -c "from gluon.main import save_password; save_password('$PW',443)" && \
    python3 -c "from gluon.main import save_password; save_password('$PW',8<PASSWORD>)"

# copy nginx config
ADD web2py /etc/nginx/conf.d/default.conf

RUN mkdir /certs

WORKDIR /certs

RUN openssl genrsa -passout pass:$CERT_PASS 2048 > web2py.key && \
    openssl req -new -x509 -nodes -sha1 -days 1780 -subj "/C=US/ST=Denial/L=Chicago/O=Dis/CN=$CERT_DOMAIN" -key web2py.key > web2py.crt && \
    openssl x509 -noout -fingerprint -text < web2py.crt > web2py.info

# add VARIA source, use /root as HOME
WORKDIR /root
COPY RandomMetroidSolver.tar.gz /root/RandomMetroidSolver.tar.gz
RUN if [ -n "${GITHUB_TOKEN}" ]; then \
    git clone --recurse-submodules -b ${BRANCH} https://${GITHUB_TOKEN}:x-oauth-basic@github.com/theonlydude/RandomMetroidSolver.git; \
else \
    wget https://github.com/theonlydude/RandomMetroidSolver/archive/${BRANCH}.zip && unzip ${BRANCH}.zip && mv RandomMetroidSolver-${BRANCH} RandomMetroidSolver && rm -f ${BRANCH}.zip; \
    cd RandomMetroidSolver; \
    rm -rf varia_custom_sprites && wget https://github.com/theonlydude/varia_custom_sprites/archive/main.zip && unzip main.zip && mv varia_custom_sprites-main varia_custom_sprites && rm -f main.zip; \
fi

# fetch race mode, only through github because private repo
RUN if [ -n "${GITHUB_TOKEN}" ]; then git clone https://${GITHUB_TOKEN}:x-oauth-basic@github.com/theonlydude/varia-race-mode; fi

# add communitry presets
WORKDIR /root/web2py
RUN mkdir -p /root/web2py/varia_repository
RUN wget https://github.com/theonlydude/community_presets/archive/master.zip && unzip master.zip && mv community_presets-master community_presets && rm -f master.zip

# add symbolic links and other web2py customization
RUN ln -s /root/RandomMetroidSolver/rando_presets /root/web2py/rando_presets
RUN ln -s /root/RandomMetroidSolver/standard_presets /root/web2py/standard_presets
RUN rm -f /web2py/routes.py && ln -s /root/RandomMetroidSolver/web/static/routes.py /root/web2py/routes.py
RUN mkdir -p /root/web2py/plandository /root/web2py/roms /root/web2py/applications/solver

WORKDIR /root/web2py/applications/solver
RUN mkdir cache  controllers  cron  databases  errors  languages  models  modules  private  sessions  static  uploads  views
RUN mkdir -p views/solver_web && touch views/solver_web/__init__.py
WORKDIR /root/web2py/applications/solver/static
RUN mkdir -p js graph fonts images/sprite_sheets css

# varia install
RUN /root/RandomMetroidSolver/web/install.sh
RUN /root/RandomMetroidSolver/varia_custom_sprites/install.sh
RUN if [ -n "${GITHUB_TOKEN}" ]; then VARIA_DIR=/root/RandomMetroidSolver /root/varia-race-mode/install.sh; fi

# add db conf
RUN echo "dbParams = dict(host='varia-mysql', user='varia', database='varia', password='<PASSWORD>', port=3306)" > /root/RandomMetroidSolver/db_params.py

# create empty database

WORKDIR /

COPY nginx.conf /etc/supervisor/conf.d/nginx.conf
COPY web2py.conf /etc/supervisor/conf.d/web2py.conf
CMD ["supervisord", "-n"]
{'fraction_non_alphanumeric': 0.12085368989457444, 'fraction_numerical': 0.01761378246335819, 'mean_word_length': 4.295439074200136, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 22, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '639337', 'n_tokens_mistral': 2938, 'n_tokens_neox': 2828, 'n_words': 658}