Skip to content

Commit b7485d2

Browse files
committed
non broken upon start, still needs changes
1 parent 1e7318f commit b7485d2

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

.devcontainer/Dockerfile

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,29 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
99
&& apt-get install -y --no-install-recommends \
1010
libpoppler-cpp-dev \
1111
python-is-python3 \
12+
python3-venv \
13+
python3-dev \
1214
gdal-bin \
1315
libgdal-dev \
1416
imagemagick \
1517
libmagickwand-dev \
18+
meson \
19+
ninja-build \
20+
pkg-config \
1621
&& apt-get clean \
1722
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
1823

24+
# Explicitly set PKG_CONFIG_PATH if necessary
25+
ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
26+
27+
# Create and activate a virtual environment
28+
# RUN apt-get install python3-venv
29+
RUN python -m venv /opt/venv
30+
ENV PATH="/opt/venv/bin:$PATH"
31+
32+
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python get-pip.py && rm get-pip.py
33+
# RUN pip install --upgrade pip && pip install
34+
1935
# [Option] Install zsh
2036
ARG INSTALL_ZSH="true"
2137
# [Option] Upgrade OS packages to their latest versions
@@ -33,8 +49,8 @@ ENV DOCKER_BUILDKIT=1
3349
ARG USERNAME=automatic
3450
ARG USER_UID=1000
3551
ARG USER_GID=$USER_UID
36-
COPY library-scripts/*.sh /library-scripts/
37-
# COPY library-scripts/*.sh /tmp/library-scripts/
52+
# COPY library-scripts/*.sh /library-scripts/
53+
COPY library-scripts/*.sh /tmp/library-scripts/
3854

3955
RUN apt-get update \
4056
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
@@ -48,13 +64,14 @@ RUN echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} \
4864
&& chmod 0440 /etc/sudoers.d/${USERNAME}
4965

5066
# Set working directory to the project root
51-
# WORKDIR /workspaces/uipa
67+
WORKDIR /workspaces/uipa
5268

5369
# Copy requirements.txt and init_db.sh to the container
5470

5571
# COPY requirements.txt /workspaces/uipa/ worked when moved inside same dir of docker
5672
COPY ../requirements.txt /workspaces/uipa/
5773

74+
# RUN pip install --upgrade pip && pip install -r /workspaces/uipa/requirements.txt
5875

5976
# COPY init_db.sh tmp/workspaces/uipa/data/seed/
6077
# COPY ../init_db.sh /workspaces/uipa/data/seed/
@@ -63,8 +80,9 @@ COPY ../requirements.txt /workspaces/uipa/
6380
RUN echo "Displaying requirements.txt:" && cat /workspaces/uipa/requirements.txt
6481

6582
# Install Python dependencies
66-
RUN pip install -r /workspaces/uipa/requirements.txt \
67-
&& chmod +x /workspaces/uipa/data/seed/init_db.sh
83+
RUN pip install -r /workspaces/uipa/requirements.txt
84+
85+
# RUN chmod +x /workspaces/uipa/data/seed/init_db.sh
6886

6987
# Set ENTRYPOINT to run docker and your initialization script
7088
ENTRYPOINT ["/bin/sh", "-c", "dockerd & while(! docker info > /dev/null 2>&1); do sleep 1; done; cd /workspaces/uipa && ./data/seed/init_db.sh && python manage.py runserver 0.0.0.0:8000"]

0 commit comments

Comments
 (0)