Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
/ flask_nsfw Public archive

Yahoo's open_nsfw as a flask web service

Notifications You must be signed in to change notification settings

pvdyck/flask_nsfw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flask_nsfw

To ensure a reproducible execution environment for this app, development has proceeded in Docker from the start. The base image used is caffe:cpu, which can take some time to build if you don't have it cached.

The scripts/ directory contains a Bash script, flask_nsfw, which saves you the headache of having to remember the exact Docker CLI invocations that start the app container. Available commands are build, test, run, and shell.

First, run:

$ flask_nsfw build

This will prepare a Docker image tagged flask_nsfw. If this label doesn't suit you, edit the NAME variable in scripts/flask_nsfw before building.

To test the image:

$ flask_nsfw test

The contents of the src/ directory are copied into the image during build. If you make any changes to the source, either rebuild the image, or, preferably, by passing dev as first argument, for example:

$ flask_nsfw dev run

The above command will start Flask with the src/ directory mounted as a Docker volume. Thus any changes made to the source will be immediately reflected inside the container. Therefore, it is recommended to start the container in production via:

$ flask_nsfw run

To get a Bash prompt in the container, use:

$ flask_nsfw shell

Again, if you don't pass dev as first argument, you'll be stuck with the original version of the app code.

About

Yahoo's open_nsfw as a flask web service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published