Create Dockerfile
Browse files- Dockerfile +48 -0
Dockerfile
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM selenium/node-chrome
|
| 2 |
+
|
| 3 |
+
ENV SE_SCREEN_WIDTH 1850
|
| 4 |
+
ENV G4F_LOGIN_URL http://localhost:7900/?autoconnect=1&resize=scale&password=secret
|
| 5 |
+
ENV PYTHONUNBUFFERED 1
|
| 6 |
+
ARG G4F_VERSION
|
| 7 |
+
ENV G4F_VERSION ${G4F_VERSION}
|
| 8 |
+
|
| 9 |
+
USER root
|
| 10 |
+
|
| 11 |
+
# Python packages
|
| 12 |
+
RUN apt-get -qqy update \
|
| 13 |
+
&& apt-get -qqy install \
|
| 14 |
+
python3 \
|
| 15 |
+
python-is-python3 \
|
| 16 |
+
pip \
|
| 17 |
+
git
|
| 18 |
+
|
| 19 |
+
RUN git clone https://github.com/xtekky/gpt4free.git /tmp/
|
| 20 |
+
|
| 21 |
+
# Cleanup
|
| 22 |
+
RUN rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
|
| 23 |
+
&& apt-get -qyy autoremove \
|
| 24 |
+
&& apt-get -qyy clean
|
| 25 |
+
|
| 26 |
+
# Update entrypoint
|
| 27 |
+
RUN cp /tmp/gpt4free/docker/supervisor.conf /etc/supervisor/conf.d/selenium.conf
|
| 28 |
+
|
| 29 |
+
# Change background image
|
| 30 |
+
RUN cp /tmp/gpt4free/docker/background.png /usr/share/images/fluxbox/ubuntu-light.png
|
| 31 |
+
|
| 32 |
+
# Switch user
|
| 33 |
+
USER 1200
|
| 34 |
+
|
| 35 |
+
# Set the working directory in the container.
|
| 36 |
+
WORKDIR /app
|
| 37 |
+
|
| 38 |
+
# Copy the project's requirements file into the container.
|
| 39 |
+
RUN cp /tmp/gpt4free/requirements.txt /app/
|
| 40 |
+
|
| 41 |
+
# Upgrade pip for the latest features and install the project's Python dependencies.
|
| 42 |
+
RUN pip install --upgrade pip && pip install -r requirements.txt
|
| 43 |
+
|
| 44 |
+
# Copy the entire package into the container.
|
| 45 |
+
RUN cp -r /tmp/gpt4free/g4f /app/g4f
|
| 46 |
+
|
| 47 |
+
# Expose ports
|
| 48 |
+
EXPOSE 80 1337
|