-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
50 lines (35 loc) · 1.13 KB
/
Dockerfile
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
FROM ubuntu:22.04
# NOTE:
# python:3.11.4-bookworm とかを使った場合,Selenium を同時に複数動かせないので,
# Ubuntu イメージを使う
ENV TZ=Asia/Tokyo
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --assume-yes \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get update && apt-get install --assume-yes \
language-pack-ja tzdata \
python3 python3-pip \
smem \
./google-chrome-stable_current_amd64.deb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /opt/mercari_bot
RUN locale-gen en_US.UTF-8
RUN locale-gen ja_JP.UTF-8
COPY font /usr/share/fonts/
# NOTE: apt にあるものはバージョンが古いので直接入れる
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="/root/.local/bin:$PATH"
COPY pyproject.toml .
RUN poetry config virtualenvs.create false \
&& poetry install \
&& rm -rf ~/.cache
RUN useradd -m ubuntu
COPY . .
RUN mkdir -p data
RUN chown -R ubuntu:ubuntu .
USER ubuntu
CMD ["./app/mercari_bot.py", "-l"]