Public | Automated Build

Last pushed: 6 months ago
Short Description
Uploading and fetching of images
Full Description

udaChef image upload service

Make sure you have either yarn or npm installed globally

Install everything needed by running:


If you simply want to run the project

yarn start

If you want to run it with a watcher, allowing for faster development

yarn run watch

To deploy

yarn run build
yarn run serve

To test

Start the server and direct your browser to localhost:5000
and use the form to upload one or several images. To see your uploaded image go to
localhost:5000/{image.path}, where image.path can be found in the upload response


To run the dockerized version you first must build the docker image.
Step into the /udachef-image-service directory and run

docker build -t <your-username>:udachef-image-service .

You have now built the docker image. Too see your images run docker images

To run your image inside a container run

docker run -d -p <port-you-want>:5000 <image-name>

This will use the volume inside the docker container and all images uploaded here will therefore be removed if you
kill the container.

If you want to give the service access to a local folder on your computer (thus persisting storage)

docker run -d -v <absolute-path-to-folder>:/usr/app/images -p <port-you-want>:3000 <image-name>

Where <absolute-path-to-folder> should be on the form /Users/<username>/<path>

To see your running containers run

docker ps

To see that the volume mounting proceeded correctly you can enter the container by running

docker exec -it <container-id> /bin/bash

and step into /usr/app/images. Here you should see the same files as on your local machine.
Any changes in the container will be reflected in the local folder and vice versa

To stop or kill a running container run (<container-id> from above command )

docker stop <container-id> 
docker kill <container-id>
Docker Pull Command
Source Repository