andreped commited on
Commit
a736389
·
unverified ·
2 Parent(s): 352d280 498130b

Merge pull request #2 from andreped/huggingface

Browse files

Docker works locally (windows) - needs deployment testing on UNIX-based server

Files changed (2) hide show
  1. Dockerfile +21 -2
  2. README.md +3 -2
Dockerfile CHANGED
@@ -1,8 +1,22 @@
1
- FROM docker/compose
2
 
3
  # Switch to root user
4
  #USER root
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  WORKDIR /code
7
 
8
  COPY ./dsa /code/dsa
@@ -20,10 +34,15 @@ RUN ls
20
  #CMD docker run --privileged=true -it -v /var/run/docker.sock:/var/run/docker.sock -v /code/dsa/:/var/tmp/ docker/compose:1.24.1 -f /var/tmp/dsa/docker-compose.yml up -d
21
  #CMD ["ls"]
22
 
23
- ENTRYPOINT [ "/bin/sh" ]
 
 
24
 
25
  #RUN docker-compose pull
26
 
27
  #CMD ["docker", "run", "-it", "-v", "/var/run/docker.sock:/var/run/docker.sock", ]
28
 
 
 
 
29
  #docker run -itd -v /var/run/docker.sock:/var/run/docker.sock -v /root/test/:/var/tmp/ docker/compose:1.24.1 -f /var/tmp/docker-compose.yaml up -d
 
1
+ FROM docker/compose:debian-1.29.2
2
 
3
  # Switch to root user
4
  #USER root
5
 
6
+ #RUN apt-get install -y sudo
7
+
8
+ RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
9
+
10
+ USER docker
11
+
12
+ # Set up a new user named "user" with user ID 1000
13
+ #RUN useradd -m -u 1000 user
14
+
15
+ # Switch to the "user" user
16
+ #USER user
17
+
18
+ #RUN sudo chmod 666 /var/run/docker.sock
19
+
20
  WORKDIR /code
21
 
22
  COPY ./dsa /code/dsa
 
34
  #CMD docker run --privileged=true -it -v /var/run/docker.sock:/var/run/docker.sock -v /code/dsa/:/var/tmp/ docker/compose:1.24.1 -f /var/tmp/dsa/docker-compose.yml up -d
35
  #CMD ["ls"]
36
 
37
+ #ENTRYPOINT [ "/bin/sh" ]
38
+
39
+ #RUN cd dsa/ && docker-compose pull
40
 
41
  #RUN docker-compose pull
42
 
43
  #CMD ["docker", "run", "-it", "-v", "/var/run/docker.sock:/var/run/docker.sock", ]
44
 
45
+ # "DSA_USER=$(id -u):$(id -g)",
46
+ CMD ["docker-compose", "-f", "/code/dsa/docker-compose.yml", "up", "-d"]
47
+
48
  #docker run -itd -v /var/run/docker.sock:/var/run/docker.sock -v /root/test/:/var/tmp/ docker/compose:1.24.1 -f /var/tmp/docker-compose.yaml up -d
README.md CHANGED
@@ -11,7 +11,7 @@ license: mit
11
 
12
  # dsa4hf
13
 
14
- This project was made to showcase developed plugins for Digital Slide Archive through on Hugging Face spaces.
15
 
16
  The project is a work-in-progress. I will make a release when I have it working. Stay tuned!
17
 
@@ -24,8 +24,9 @@ When the solution is ready, the website should be accessible on [Hugging Face](h
24
  #### Development
25
 
26
  ```
 
27
  docker build -t dsa4hf .
28
- docker run -it -p 8080:8080 dsa4hf
29
  ```
30
 
31
  To go inside docker image and debug, at the bottom of the Dockerfile, add `ENTRYPOINT [ "/bin/sh" ]` before running.
 
11
 
12
  # dsa4hf
13
 
14
+ This project was made to showcase developed plugins for Digital Slide Archive through hosting on Hugging Face spaces.
15
 
16
  The project is a work-in-progress. I will make a release when I have it working. Stay tuned!
17
 
 
24
  #### Development
25
 
26
  ```
27
+ git clone https://github.com/andreped/dsa4hf.git
28
  docker build -t dsa4hf .
29
+ docker run -it -p 7860:7860 dsa4hf
30
  ```
31
 
32
  To go inside docker image and debug, at the bottom of the Dockerfile, add `ENTRYPOINT [ "/bin/sh" ]` before running.