pannman commited on
Commit
b91f277
Β·
1 Parent(s): fd885bb

change docker enviromnment

Browse files
Files changed (5) hide show
  1. .env.dev.template +0 -1
  2. .gitignore +6 -2
  3. Dockerfile +1 -1
  4. docker-compose.yaml +1 -2
  5. 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/work
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/work
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/work
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 lock --check || echo "WARNING: poetry.lock is out of date. Run 'poetry lock' to update."
12
-
13
- # Compare dependencies
14
- lock_deps=$(poetry export --format requirements.txt --without-hashes | sort)
15
- pyproject_deps=$(poetry export --format requirements.txt --without-hashes --without-urls | sort)
16
- [ "$lock_deps" != "$pyproject_deps" ] && echo "WARNING: Dependencies mismatch. Run 'poetry lock' to update."
 
 
 
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
+