Change serve dir in container to /var/www

This commit is contained in:
Jake Howard 2018-05-04 21:01:01 +01:00
parent ee45331b4d
commit a90feaffdf
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 5 additions and 6 deletions

View file

@ -4,11 +4,10 @@ COPY ./src /app/src
COPY ./package.json /app/package.json COPY ./package.json /app/package.json
COPY ./package-lock.json /app/package-lock.json COPY ./package-lock.json /app/package-lock.json
COPY ./tsconfig.json /app/tsconfig.json COPY ./tsconfig.json /app/tsconfig.json
COPY ./site /var/www
WORKDIR /app WORKDIR /app
RUN mkdir -p /public
RUN apk add --no-cache git RUN apk add --no-cache git
RUN npm install RUN npm install
@ -19,6 +18,6 @@ RUN npm run build
RUN npm prune --production RUN npm prune --production
CMD npm start -- /public CMD npm start -- /var/www
EXPOSE 5000 EXPOSE 5000

View file

@ -37,7 +37,7 @@ The only static-file server you'll ever need!
The port for the server to listen on. Currently supports plain HTTP only The port for the server to listen on. Currently supports plain HTTP only
##### `basic-auth` ##### `basic-auth`
Enable basic-auth for all paths. Currently only supports single credentals. Enable basic-auth for all paths. Currently only supports single credentals.
Format:`-b username:password` Format:`-b username:password`
@ -53,7 +53,7 @@ Enables directory listing. Allow browseing
Open the server in the browser one started. It will open in your default browser, and use url `http://0.0.0.0:<port>`. Open the server in the browser one started. It will open in your default browser, and use url `http://0.0.0.0:<port>`.
### Docker ### Docker
Included in this repo is a `Dockerfile` to use. The default setup requires being run from the project directory, and will serve `/public` in the container on port `5000`. By default, this directory is empty, however can be overriden. Included in this repo is a `Dockerfile` to use. The default setup requires being run from the project directory, and will serve `/var/www` in the container on port `5000`. By default, this directory is empty, however can be overriden.
Below is an example `docker-compose.yml` file you can use with it: Below is an example `docker-compose.yml` file you can use with it:
@ -66,7 +66,7 @@ services:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
volumes: volumes:
- ./site/:/public - ./site/:/var/www
ports: ports:
- "5000:5000" - "5000:5000"
``` ```