Skip to content

Commit 4950ede

Browse files
committed
able to copy requirements, but not init sh. Also updated devcontainer to add workspace folder as it requires it
1 parent 9d99d46 commit 4950ede

3 files changed

Lines changed: 51 additions & 13 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
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
78
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
@@ -33,6 +34,8 @@ ARG USERNAME=automatic
3334
ARG USER_UID=1000
3435
ARG USER_GID=$USER_UID
3536
COPY library-scripts/*.sh /tmp/library-scripts/
37+
COPY .devcontainer/library-scripts/*.sh /tmp/library-scripts/
38+
3639
RUN 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 \
4447
RUN 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
5963
RUN echo "Displaying requirements.txt:" && cat /workspaces/uipa/requirements.txt
@@ -62,11 +66,8 @@ RUN echo "Displaying requirements.txt:" && cat /workspaces/uipa/requirements.txt
6266
RUN 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
6873
CMD ["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>

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "UIPA DevBox",
33
"dockerComposeFile": "docker-compose.yml",
44
"service": "app",
5+
"workspaceFolder": "/workspaces/uipa",
56
"forwardPorts": [8000, 5432, 9200],
67
"customizations": {
78
"vscode": {

.devcontainer/requirements.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
django==4.2.4
2+
Markdown==3.4.3
3+
celery==5.2.7
4+
django-celery-email==3.0.0
5+
django-taggit==4.0.0
6+
pytz==2023.3
7+
requests==2.31.0
8+
django-floppyforms==1.9.0
9+
python-magic==0.4.27
10+
python-mimeparse==1.6.0
11+
django-configurations==2.5.1
12+
django-storages==1.13.2
13+
dj-database-url==2.0.0
14+
django-contrib-comments==2.2.0
15+
unicodecsv==0.14.1
16+
django-tinymce==3.6.1
17+
python-docx==0.8.11
18+
elasticsearch==8.11.1
19+
20+
-e git+https://github.com/codewithaloha/froide.git@main#egg=froide
21+
22+
lxml==5.2.1
23+
channels==4.0.0
24+
django-treebeard==4.4
25+
django-leaflet==0.29.0
26+
django-json-widget==1.1.1
27+
django-celery-beat==2.5.0
28+
django-mfa3==0.11.0
29+
psycopg[binary]==3.1.18
30+
psycopg-binary==3.1.18
31+
-e git+https://github.com/okfde/django-filingcabinet.git@main#egg=django-filingcabinet
32+
oauthlib==3.2.2
33+
django-oauth-toolkit==1.7.1
34+
django-fsm==2.8.1
35+
websockets==11.0.3
36+
bleach==6.0.0

0 commit comments

Comments
 (0)