11# Note: You can use any Debian/Ubuntu based image you want.
2- FROM mcr.microsoft.com/vscode/devcontainers/base:bullseye
2+ # FROM mcr.microsoft.com/vscode/devcontainers/base:bullseye
33# FROM mcr.microsoft.com/devcontainers/universal:2
44
5+ FROM mcr.microsoft.com/vscode/devcontainers/base:bullseye
56
67# Install main dependencies in one step to reduce layers
78RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
@@ -33,6 +34,8 @@ ARG USERNAME=automatic
3334ARG USER_UID=1000
3435ARG USER_GID=$USER_UID
3536COPY library-scripts/*.sh /tmp/library-scripts/
37+ COPY .devcontainer/library-scripts/*.sh /tmp/library-scripts/
38+
3639RUN apt-get update \
3740 && /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
3841 # Use Docker script from script library to set things up
@@ -44,16 +47,17 @@ RUN apt-get update \
4447RUN echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} \
4548 && chmod 0440 /etc/sudoers.d/${USERNAME}
4649
47- # Ensure the .devcontainer directory exists and is owned by the user
48- # RUN mkdir -p /workspaces/uipa/.devcontainer \
49- # && chown -R ${USER_UID}:${USER_GID} /workspaces/uipa
50-
5150# Set working directory to the project root
52- WORKDIR /workspaces/uipa
51+ # WORKDIR /workspaces/uipa
5352
5453# Copy requirements.txt and init_db.sh to the container
55- COPY requirements.txt /workspaces/uipa/
56- COPY data/seed/init_db.sh /workspaces/uipa/data/seed/
54+
55+ # COPY requirements.txt /workspaces/uipa/ worked when moved inside same dir of docker
56+ COPY ../requirements.txt /workspaces/uipa/
57+
58+
59+ # COPY init_db.sh tmp/workspaces/uipa/data/seed/
60+ COPY ../init_db.sh /workspaces/uipa/data/seed/
5761
5862# Debugging: display the contents of requirements.txt
5963RUN echo "Displaying requirements.txt:" && cat /workspaces/uipa/requirements.txt
@@ -62,11 +66,8 @@ RUN echo "Displaying requirements.txt:" && cat /workspaces/uipa/requirements.txt
6266RUN pip install -r /workspaces/uipa/requirements.txt \
6367 && chmod +x /workspaces/uipa/data/seed/init_db.sh
6468
65- ENTRYPOINT ["/bin/sh" , "-c" , "dockerd & while(! docker info > /dev/null 2>&1); do sleep 1; done; sudo docker-compose up -d cd /workspaces/uipa && sudo ./data/seed/init_db.sh && sudo python manage.py runserver 0.0.0.0:8000" ]
69+ # Set ENTRYPOINT to run docker and your initialization script
70+ 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" ]
6671
6772# Keep the container running
6873CMD ["sleep" , "infinity" ]
69-
70- # [Optional] Uncomment this section to install additional OS packages.
71- # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
72- # && apt-get -y install --no-install-recommends <your-package-list-here>
0 commit comments