-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (25 loc) · 863 Bytes
/
Dockerfile
File metadata and controls
37 lines (25 loc) · 863 Bytes
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
FROM python:3.13-slim
RUN apt-get update && apt-get install -yqq \
make \
postgresql-17 \
sudo \
curl
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
ENV UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy
WORKDIR /app
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev --no-install-project
COPY . .
COPY init.sql /docker-entrypoint-initdb.d/
# postgres config
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/17/main/pg_hba.conf && \
echo "listen_addresses='*'" >> /etc/postgresql/17/main/postgresql.conf
# create docker user and db
RUN service postgresql start && \
su postgres -c "psql --command \"CREATE USER docker WITH SUPERUSER PASSWORD 'docker';\"" && \
su postgres -c "createdb -O docker docker" && \
service postgresql stop
COPY run.sh ./run.sh
RUN chmod +x ./run.sh
CMD ./run.sh