m4k1-dev commited on
Commit
f7b7b45
·
1 Parent(s): f3c9832

dockerfile adjustment

Browse files
Files changed (3) hide show
  1. Dockerfile +7 -2
  2. README.md +2 -3
  3. docker-compose.yml +0 -12
Dockerfile CHANGED
@@ -10,6 +10,7 @@ RUN groupadd --gid $USER_GID $USERNAME \
10
  # Copy required files
11
  RUN mkdir -p /modelapi && mkdir -p /home/$USERNAME/.modelapi
12
  COPY app /modelapi/app
 
13
  COPY pyproject.toml /modelapi/pyproject.toml
14
 
15
  # Setup permissions
@@ -18,9 +19,13 @@ RUN chown -R $USER_UID:$USER_GID /modelapi \
18
  && chown -R $USER_UID:$USER_GID /home/$USERNAME \
19
  && chmod -R 755 /home/$USERNAME \
20
  && chmod -R 755 /modelapi \
21
- && chmod -R 777 /home/$USERNAME/.modelapi
22
 
23
- # Change to the user and do subnet installation
24
  USER $USERNAME
25
 
26
  RUN /bin/bash -c "python3 -m venv /modelapi/.venv && source /modelapi/.venv/bin/activate && pip3 install -e /modelapi/."
 
 
 
 
 
10
  # Copy required files
11
  RUN mkdir -p /modelapi && mkdir -p /home/$USERNAME/.modelapi
12
  COPY app /modelapi/app
13
+ COPY sgmse /modelapi/sgmse
14
  COPY pyproject.toml /modelapi/pyproject.toml
15
 
16
  # Setup permissions
 
19
  && chown -R $USER_UID:$USER_GID /home/$USERNAME \
20
  && chmod -R 755 /home/$USERNAME \
21
  && chmod -R 755 /modelapi \
22
+ && chmod -R 755 /home/$USERNAME/.modelapi
23
 
24
+ # Change to the user
25
  USER $USERNAME
26
 
27
  RUN /bin/bash -c "python3 -m venv /modelapi/.venv && source /modelapi/.venv/bin/activate && pip3 install -e /modelapi/."
28
+
29
+ EXPOSE 6500
30
+
31
+ CMD ["/bin/bash", "-c", "source /modelapi/.venv/bin/activate && python3 /modelapi/app/run.py"]
README.md CHANGED
@@ -25,9 +25,8 @@ For your model to be processed by validators, there are a few formatting require
25
 
26
  1. API endpoints must as outlined above.
27
  2. Port must be 6500.
28
- 3. There should only be one service in `docker-compose.yml`.
29
- 4. Container must be configured to run as non-root user.
30
- 5. Container names cannot be any of the following:
31
 
32
  - common-validator
33
  - soundsright-validator-debug-mode
 
25
 
26
  1. API endpoints must as outlined above.
27
  2. Port must be 6500.
28
+ 3. Container must be configured to run as non-root user.
29
+ 4. Container names cannot be any of the following:
 
30
 
31
  - common-validator
32
  - soundsright-validator-debug-mode
docker-compose.yml DELETED
@@ -1,12 +0,0 @@
1
- services:
2
- modelapi:
3
- build:
4
- context: .
5
- container_name: modelapi
6
- ports:
7
- - "6500:6500"
8
- environment:
9
- USER_UID: 10002
10
- USER_GID: 10002
11
- USERNAME: modelapi
12
- command: /bin/bash -c "source /modelapi/.venv/bin/activate && python3 /modelapi/app/run.py"