https://github.com/jnt0r/angular-server-image
Dockerfile to build angular project and serve using nginx
https://github.com/jnt0r/angular-server-image
angular dockerfile dockerfiles nginx
Last synced: 5 months ago
JSON representation
Dockerfile to build angular project and serve using nginx
- Host: GitHub
- URL: https://github.com/jnt0r/angular-server-image
- Owner: jnt0r
- Created: 2020-06-08T19:17:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-14T19:35:05.000Z (over 5 years ago)
- Last Synced: 2025-03-27T21:47:50.619Z (10 months ago)
- Topics: angular, dockerfile, dockerfiles, nginx
- Language: Dockerfile
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Angular-Server docker image
Dockerfile to build angular project and serve using nginx.
## Usage
Copy the Dockerfile you want to use and past it inside the root of your angular project. Then you can build the image using
```docker build . --rm -t YOUR_IMAGE_NAME```
To run your container, run
```docker run -d --rm -p 80:80 -p 443:443 --name YOUR_CONTAINER_NAME YOUR_IMAGE_NAME```
To speed up image creation and minimize container size add an `.dockerignore` file. You can copy the example one inside this repository ([file](https://github.com/jnt0r/angular-server-image/blob/master/.dockerignore)).
# Dockerfile options
There are two Dockerfiles in this repository. The `Dockerfile` creates nginx server without ssl enabled. The `Dockerfile.localhost` creates a DEVELOPMENT server with an ssl certificate for localhost. To use this Dockerfile with the certificate you also need the `localhost-ssl.conf` inside the root of your project.
## Other installation options
To automatically get the newest version on build, you can use this command to build your image.
```curl https://raw.githubusercontent.com/jnt0r/angular-server-image/master/Dockerfile | docker build -f - . -t YOUR_IMAGE_NAME```
You then don't need to copy the Dockerfile to your project. The dockerignore file is still usefull then. This command uses the stdin functionality of docker ([docker documentation](https://docs.docker.com/engine/reference/commandline/build/#build-with--)).
## Coming soon / Planned functionality
- Https/ssl (using certbot and let's encrypt)