forked from wodsuz/EasyApplyJobsBot
-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile-headless
33 lines (24 loc) · 1.16 KB
/
Dockerfile-headless
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
# TODO Update the base image to the latest version after the release of python:3.12-alpine3.21 because python:3.12-alpine3.20's webdriver is not working
FROM python:3.12-alpine3.19
ENV PYTHONUNBUFFERED=1
# Define where Chrome will store its user data
ENV CHROME_USER_DATA_DIR=/home/user/chrome_data
# Install Chromium and dependencies
RUN apk add --no-cache chromium chromium-chromedriver
# Create symbolic links for the expected Google Chrome names to the Chromium executable
RUN ln -s /usr/bin/chromium-browser /usr/bin/google-chrome && \
ln -s /usr/bin/chromium-browser /usr/bin/google-chrome-stable && \
ln -s /usr/bin/chromium-browser /usr/bin/google-chrome-beta && \
ln -s /usr/bin/chromium-browser /usr/bin/google-chrome-dev
# Copy the requirements file and install Python dependencies
COPY ./requirements.txt /requirements.txt
RUN pip install --upgrade pip && pip install -r /requirements.txt
# Create a directory for your application and set permissions
RUN mkdir /app && chmod -R 777 /app
# Copy the application files
COPY . /app
# Set the working directory
WORKDIR /app
# Use an unprivileged user to run the app
# RUN adduser -D user
# USER user