Spaces:
Sleeping
Sleeping
pannman commited on
Commit ·
b91f277
1
Parent(s): fd885bb
change docker enviromnment
Browse files- .env.dev.template +0 -1
- .gitignore +6 -2
- Dockerfile +1 -1
- docker-compose.yaml +1 -2
- entrypoint.sh +13 -9
.env.dev.template
CHANGED
|
@@ -1,2 +1 @@
|
|
| 1 |
# .env.dev
|
| 2 |
-
DATA_DIRECTORY= #データが入っているフォルダ
|
|
|
|
| 1 |
# .env.dev
|
|
|
.gitignore
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
#custom
|
| 2 |
.env
|
| 3 |
-
|
| 4 |
# Byte-compiled / optimized / DLL files
|
| 5 |
__pycache__/
|
| 6 |
*.py[cod]
|
|
@@ -162,8 +162,12 @@ cython_debug/
|
|
| 162 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
| 163 |
#.idea/
|
| 164 |
|
|
|
|
|
|
|
| 165 |
|
| 166 |
#Only the directory structure is retained under the "data" directory.
|
| 167 |
/data/**
|
| 168 |
!/data/**/
|
| 169 |
-
!/data/**/.gitkeep
|
|
|
|
|
|
|
|
|
| 1 |
#custom
|
| 2 |
.env
|
| 3 |
+
.env.dev
|
| 4 |
# Byte-compiled / optimized / DLL files
|
| 5 |
__pycache__/
|
| 6 |
*.py[cod]
|
|
|
|
| 162 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
| 163 |
#.idea/
|
| 164 |
|
| 165 |
+
#poetory
|
| 166 |
+
/.local
|
| 167 |
|
| 168 |
#Only the directory structure is retained under the "data" directory.
|
| 169 |
/data/**
|
| 170 |
!/data/**/
|
| 171 |
+
!/data/**/.gitkeep
|
| 172 |
+
|
| 173 |
+
.bash_history
|
Dockerfile
CHANGED
|
@@ -13,7 +13,7 @@ RUN curl -sSL https://install.python-poetry.org | python && \
|
|
| 13 |
ln -s /opt/poetry/bin/poetry && \
|
| 14 |
poetry config virtualenvs.create false
|
| 15 |
|
| 16 |
-
WORKDIR /root
|
| 17 |
|
| 18 |
COPY entrypoint.sh /entrypoint.sh
|
| 19 |
RUN chmod +x /entrypoint.sh
|
|
|
|
| 13 |
ln -s /opt/poetry/bin/poetry && \
|
| 14 |
poetry config virtualenvs.create false
|
| 15 |
|
| 16 |
+
WORKDIR /root
|
| 17 |
|
| 18 |
COPY entrypoint.sh /entrypoint.sh
|
| 19 |
RUN chmod +x /entrypoint.sh
|
docker-compose.yaml
CHANGED
|
@@ -6,8 +6,7 @@ services:
|
|
| 6 |
context: .
|
| 7 |
dockerfile: Dockerfile
|
| 8 |
volumes:
|
| 9 |
-
- .:/root/
|
| 10 |
-
- ${DATA_DIRECTORY}:/root/data
|
| 11 |
tty: true
|
| 12 |
env_file:
|
| 13 |
- .env.dev
|
|
|
|
| 6 |
context: .
|
| 7 |
dockerfile: Dockerfile
|
| 8 |
volumes:
|
| 9 |
+
- .:/root/
|
|
|
|
| 10 |
tty: true
|
| 11 |
env_file:
|
| 12 |
- .env.dev
|
entrypoint.sh
CHANGED
|
@@ -1,21 +1,25 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
cd /root
|
| 4 |
|
| 5 |
# Check for pyproject.toml
|
| 6 |
[ ! -f pyproject.toml ] && { echo "ERROR: pyproject.toml not found."; exit 1; }
|
| 7 |
|
| 8 |
-
# Check poetry.lock and its consistency
|
| 9 |
if [ -f poetry.lock ]; then
|
|
|
|
| 10 |
echo "Checking poetry.lock consistency..."
|
| 11 |
-
poetry
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
| 17 |
else
|
| 18 |
echo "WARNING: poetry.lock not found. Run 'poetry lock' to create it."
|
| 19 |
fi
|
| 20 |
|
| 21 |
-
exec
|
|
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
+
cd /root
|
| 4 |
|
| 5 |
# Check for pyproject.toml
|
| 6 |
[ ! -f pyproject.toml ] && { echo "ERROR: pyproject.toml not found."; exit 1; }
|
| 7 |
|
|
|
|
| 8 |
if [ -f poetry.lock ]; then
|
| 9 |
+
echo "poetry.lock found. "
|
| 10 |
echo "Checking poetry.lock consistency..."
|
| 11 |
+
poetry check --lock || echo "WARNING: poetry.lock is out of date. Run 'poetry lock' to update."
|
| 12 |
+
echo "Proceeding with installation..."
|
| 13 |
+
poetry install --no-root
|
| 14 |
+
if [ $? -eq 0 ]; then
|
| 15 |
+
echo "Dependencies installed successfully from poetry.lock"
|
| 16 |
+
else
|
| 17 |
+
echo "ERROR: Failed to install dependencies from poetry.lock"
|
| 18 |
+
exit 1
|
| 19 |
+
fi
|
| 20 |
else
|
| 21 |
echo "WARNING: poetry.lock not found. Run 'poetry lock' to create it."
|
| 22 |
fi
|
| 23 |
|
| 24 |
+
exec /bin/bash
|
| 25 |
+
|